---
name: "nng_listener_start"
section: "3"
platform: "linux"
package: "libnng-dev"
version: "1.10.1-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/nng_listener_start"
---

# nng\_listener\_start(3)

start listener

## NAME

nng\_listener\_start - start listener

## SYNOPSIS

```
#include <nng/nng.h>
int nng_listener_start(nng_listener l, int flags);
```

## DESCRIPTION

The `nng_listener_start()` function starts the listener *l*.

This causes the listener to bind to the address it was created with, and to start accepting connections from remote dialers. Each new connection results in an `nng_pipe` object, which will be attached to the listener’s socket.

The *flags* argument is ignored, but reserved for future use.

Once a listener has started, it is generally not possible to change its configuration.

## RETURN VALUES

This function returns 0 on success, and non-zero otherwise.

## ERRORS

`NNG_ECLOSED`

Parameter *l* does not refer to an open listener.

`NNG_ESTATE`

The listener *l* is already started.

## SEE ALSO

[nng\_listen(3)](/nng_listen/3.md), [nng\_listener\_create(3)](/nng_listener_create/3.md) [nng\_listener(5)](/nng_listener/5.md), [nng\_strerror(3)](/nng_strerror/3.md), [nng(7)](/nng/7.md)
