NNG_DIALER_START(3) | NNG Reference Manual | NNG_DIALER_START(3) |
nng_dialer_start - start dialer
#include <nng/nng.h> int nng_dialer_start(nng_dialer d, int flags);
The nng_dialer_start() function starts the dialer d.
This causes the dialer to start connecting to the address with which it was created.
When a connection is established, it results in a pipe being created, which will be attached to the dialer’s socket.
Normally, the first attempt to connect to the dialer’s address is done synchronously, including any necessary name resolution. As a result, a failure, such as if the connection is refused, will be returned immediately, and no further action will be taken.
However, if the special value NNG_FLAG_NONBLOCK is supplied in flags, then the connection attempt is made asynchronously.
Furthermore, if the connection was closed for a synchronously dialed connection, the dialer will still attempt to redial asynchronously.
While NNG_FLAG_NONBLOCK can help an
application be more resilient,
it also generally makes diagnosing failures somewhat more difficult.
Once a dialer has started, it is generally not possible to change its configuration.
This function returns 0 on success, and non-zero otherwise.
NNG_EADDRINVAL
NNG_ECLOSED
NNG_ECONNREFUSED
NNG_ECONNRESET
NNG_EINVAL
NNG_ENOMEM
NNG_EPEERAUTH
NNG_EPROTO
NNG_ESTATE
NNG_EUNREACHABLE
nng_dial(3), nng_dialer_create(3) nng_strerror(3), nng_dialer(5), nng(7)
2025-01-05 |