nanomsg next generation NNG  
Home GitHub Documentation

This documentation is for version v1.2.2 of nng, but the latest released version is v1.3.0. see the documentation for v1.3.0 for the most up-to-date information.
nng_stream(5)

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.

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().

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.

NNG Reference Manual vv1.2.2 © 2019 Staysail Systems, Inc, © 2018 Capitar IT Group BV
This document is supplied under the MIT License.
nanomsg™ and nng™ are trademarks of Garrett D'Amore.