#include <nng/nng.h> int nng_listener_create(nng_listener *listenerp, nng_socket s, const char *url);
|This documentation is for the TIP (development tree) of NNG and may represent unreleased changes or functionality that is experimental, and is subject to change before release. The latest released version is v1.3.2. See the documentation for v1.3.2 for the most up-to-date information.|
nng_listener_create - create listener
nng_listener_create() function creates a newly initialized
nng_listener object, associated with socket s,
and configured to listen at the address specified by url,
and stores a pointer to at the location referenced by listenerp.
Listeners are used to accept connections initiated by remote dialers. An incoming connection generally results in a pipe being created and attached to the socket s. Unlike dialers, listeners generally can create many pipes, which may be open concurrently.
|While it is convenient to think of listeners as servers, the relationship between the listener or dialer is orthogonal to any server or client status that might be associated with a given protocol. For example, a req socket might have associated dialers, but might also have associated listeners. It may even have some of each at the same time!|
The listener is not started, but may be further configured with
nng_listener_setopt() family of
Once it is fully configured, the listener may be started using the
If no specific configuration is required, consider using the
This function returns 0 on success, and non-zero otherwise.
An invalid url was specified.
The socket s is not open.
Insufficient memory is available.