SYNOPSIS
#include <nng/nng.h>
#include <nng/supplemental/tcp/tcp.h>
void nng_tcp_listener_accept(nng_tcp_listener *l, nng_aio *aio);
DESCRIPTION
The nng_tcp_listener_accept() attempts to accept an incoming TCP connection
from a remote peer, using the listener l.
The operation is completed asynchronously, using aio.
This operation can only be done after the listener is already bound to a TCP port and is listening.
If a connection is successfully established, the aio will have the
resulting nng_tcp stored as its first output.
(See nng_aio_get_output().)
The address of the remote peer can be determined using the
NNG_OPT_REMADDR option with the
nng_tcp_getopt() function on the
returned nng_tcp.
RETURN VALUES
None.
ERRORS
NNG_ECANCELED
|
The operation was aborted. |
NNG_ECLOSED
|
The listener is closed. |
NNG_ECONNRESET
|
The TCP connection was reset by the peer. |
NNG_ENOMEM
|
Insufficient free memory exists. |
NNG_ESTATE
|
The listener is not not listening. |