yev_setup_accept_event()

yev_setup_accept_event()#

yev_setup_accept_event() creates and configures a socket for listening on the specified listen_url with the given parameters.

Prototype

int yev_setup_accept_event(
    yev_event_h  yev_event,
    const char  *listen_url,
    int          backlog,
    BOOL         shared,
    int          ai_family,
    int          ai_flags
);

Parameters

Key

Type

Description

yev_event

yev_event_h

The event handle associated with the accept event.

listen_url

const char *

The URL specifying the address and port to listen on.

backlog

int

The maximum length of the queue for pending connections, default is 512.

shared

BOOL

Indicates whether the socket should be opened as shared.

ai_family

int

The address family, default is AF_UNSPEC to allow both IPv4 and IPv6 (AF_INET, AF_INET6).

ai_flags

int

Additional flags for address resolution, default is AI_V4MAPPED | AI_ADDRCONFIG.


Return Value

Returns 0 on success, or -1 on failure.

Notes

This function must be called before starting an accept event using yev_start_event().

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples