= nng_dialer(5)
//
// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech>
// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This document is supplied under the terms of the MIT License, a
// copy of which should be located in the distribution where this
// file was obtained (LICENSE.txt).  A copy of the license may also be
// found online at https://opensource.org/licenses/MIT.
//

== NAME

nng_dialer - dialer

== SYNOPSIS

[source, c]
-----------
#include <nng/nng.h>

typedef uint32_t nng_dialer;
-----------

== DESCRIPTION

(((dialer)))
An `nng_dialer` is a handle to a "`dialer`" object, which is responsible for
creating a single <<nng_pipe.5#,`nng_pipe`>> at a time by
establishing an outgoing connection.

If the connection is broken, or fails, the dialer object will automatically
attempt to reconnect, and will keep doing so until the dialer or socket is
destroyed.

Dialer objects are created by the
<<nng_dialer_create.3#,`nng_dialer_create()`>>
or <<nng_dial.3#,`nng_dial()`>> functions, and are always "`owned`"
by a single <<nng_socket.5#,`nng_socket`>>.

TIP: A given <<nng_socket.5#,`nng_socket`>> may have multiple dialer
objects, multiple <<nng_listener.5#,listener>> objects, or even some
of both.

TIP: The client/server relationship described by dialer/listener is
completely orthogonal to any similar relationship in the protocols.
For example, a <<nng_rep.7#,_rep_>> socket may use a dialer
to connect to a listener on an <<nng_req.7#,_req_>> socket.
This orthogonality can lead to innovative solutions to otherwise
challenging communications problems.

Dialer objects may be destroyed by the
<<nng_dialer_close.3#,`nng_pipe_close()`>> function.
They are also closed when their "`owning`" socket is closed.

== SEE ALSO

<<nng_dial.3#,nng_dial(3)>>,
<<nng_dialer_close.3#,nng_dialer_close(3)>>,
<<nng_dialer_create.3#,nng_dialer_create(3)>>,
<<nng_dialer_getopt.3#,nng_dialer_getopt(3)>>,
<<nng_dialer_setopt.3#,nng_dialer_setopt(3)>>,
<<nng_dialer_start.3#,nng_dialer_start(3)>>,
<<nng_listener.5#,nng_listener(5)>>,
<<nng_pipe.5#,nng_pipe(5)>>,
<<nng_socket.5#,nng_socket(5)>>,
<<nng.7#,nng(7)>>
