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

# nng\_stream(5)

byte stream

## NAME

nng\_stream - byte stream

## SYNOPSIS

```
#include <nng/nng.h>
typedef struct nng_stream nng_stream;
```

## DESCRIPTION

An `nng_stream`  represents a byte stream. This may correspond to an underlying connection such a TCP connection or a connected UNIX domain socket or named pipe.

**Note**\

The `nng_stream` object is used for raw byte stream connections, and should not be confused with a pipe object created on socket using the `nng_listen()`, `nng_dial()` or related functions.

These objects are created either establishing an outgoing connection with `nng_stream_dialer_dial()` or by accepting in incoming connection with `nng_stream_listener_accept()`.

Byte streams are reliable in that data will not be delivered out of order, or with portions missing.

Data can be sent using `nng_stream_send()` or received with `nng_stream_recv()`.

When the connection is no longer needed, it should be freed with `nng_stream_free()`.

**Tip**\

It is possible to close the connection, without freeing it, by using `nng_stream_close()`.

Byte streams may, depending on the underlying technology, support various options, which can be accessed using the `nng_stream_get()` and `nng_stream_set()` family of functions.

## SEE ALSO

[libnng(3)](/libnng/3.md), nng\_stream\_close(3str), nng\_stream\_dialer\_dial(3str), nng\_stream\_free(3str), nng\_stream\_get(3str), nng\_stream\_listener\_accept(3str), nng\_stream\_recv(3str), nng\_stream\_send(3str), nng\_stream\_set(3str), [nng\_options(5)](/nng_options/5.md), [nng(7)](/nng/7.md),
