<commit_before>= nng_listen(3)
//
// Copyright 2018 Staysail Systems, Inc. <<EMAIL>>
// Copyright 2018 Capitar IT Group BV <<EMAIL>>
//
// 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_listen - create and start listener

== SYNOPSIS

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

int nng_listen(nng_socket s, const char *url, nng_listener *lp, int flags);
----

== DESCRIPTION

The `nng_listen()` function creates a newly initialized
xref:nng_listener.5.adoc[`nng_listener`] object, associated with socket _s_,
and configured to listen at the address specified by _url_, and starts it.
If the value of _lp_ is not `NULL`, then
the newly created listener is stored at the address indicated by _lp_.

Listeners are used to accept connections initiated by remote dialers.
An incoming connection generally results in and
xref:nng_pipe.5.adoc[`nng_pipe`] object being created and attached to the socket _s_.
Unlike dialers, listeners generally can create many
pipes, which may be open concurrently.

The _flags_ argument is ignored, but reserved for future use.

TIP: 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 xref:nng_req.7.adoc[_req_]
socket might have associated dialers, but might also have associated listeners.
It may even have some of each at the same time!

Because the listener is started immediately, it is generally not possible<commit_msg>Fix typo. (#1479)<commit_after>= nng_listen(3)
//
// Copyright 2018 Staysail Systems, Inc. <<EMAIL>>
// Copyright 2018 Capitar IT Group BV <<EMAIL>>
//
// 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_listen - create and start listener

== SYNOPSIS

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

int nng_listen(nng_socket s, const char *url, nng_listener *lp, int flags);
----

== DESCRIPTION

The `nng_listen()` function creates a newly initialized
xref:nng_listener.5.adoc[`nng_listener`] object, associated with socket _s_,
and configured to listen at the address specified by _url_, and starts it.
If the value of _lp_ is not `NULL`, then
the newly created listener is stored at the address indicated by _lp_.

Listeners are used to accept connections initiated by remote dialers.
An incoming connection generally results in an
xref:nng_pipe.5.adoc[`nng_pipe`] object being created and attached to the socket _s_.
Unlike dialers, listeners generally can create many
pipes, which may be open concurrently.

The _flags_ argument is ignored, but reserved for future use.

TIP: 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 xref:nng_req.7.adoc[_req_]
socket might have associated dialers, but might also have associated listeners.
It may even have some of each at the same time!

Because the listener is started immediately, it is generally not possible
{'fraction_non_alphanumeric': 0.07185972980741592, 'fraction_numerical': 0.008048289738430584, 'mean_word_length': 4.37037037037037, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5869643', 'n_tokens_mistral': 1001, 'n_tokens_neox': 954, 'n_words': 489}