SYNOPSIS
#include <nng/nng.h>
typedef uint32_t nng_listener;
DESCRIPTION
An nng_listener
is a handle to a “listener” object, which is responsible for
creating nng_pipe
objects by accepting incoming connections.
A given listener object may create many pipes at the same time, much like an HTTP
server can have many connections to multiple clients simultaneously.
Listener objects are created by the
nng_listener_create()
or nng_listen()
functions, and are always “owned”
by a single nng_socket
.
A given nng_socket may have multiple listener
objects, multiple dialer objects, or even some
of both.
|
The client/server relationship described by dialer/listener is completely orthogonal to any similar relationship in the protocols. For example, a rep socket may use a dialer to connect to a listener on an req socket. This orthogonality can lead to innovative solutions to otherwise challenging communications problems. |
Listener objects may be destroyed by the
nng_listener_close()
function.
They are also closed when their “owning” socket is closed.