open_accept
open_accept (ch)
This function opens a network connection to a client using the channel identifier ch returned by a previous call to open_listen. open_accept returns -1 on failure and sets the predefined variable api_error o an error message describing the error.
open_accept is normally called from the callback established by open_listen, which responds to an open notification for the listening channel. Otherwise, open_accept locks until a connection is made.
By default, the channel is opened in a blocking mode. This means that a read from the channel blocks until the operation completes. channel_set_callback can be used to change the channel so that subsequent reads (and writes) can be non-blocking.
The original listening channel remains open.
See open_listen for an example.
Related Topics