yev_setup_connect_event()
#
yev_setup_connect_event()
creates and configures a socket for a connection event, setting the destination and source addresses, as well as socket options.
Prototype
int yev_setup_connect_event(
yev_event_h yev_event,
const char *dst_url,
const char *src_url,
int ai_family,
int ai_flags
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
The event handle associated with the connection. |
|
|
The destination URL for the connection. |
|
|
The local bind address in the format ‘host:port’. |
|
|
The address family, default is |
|
|
Additional address resolution flags, default is |
Return Value
Returns 0
on success, or -1
on failure.
Notes
If a file descriptor is already set in yev_event
, it will be closed and replaced with the new socket. This function should be called before yev_start_event()
.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples