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.


#include <nng/nng.h>

void nng_stream_close(nng_stream *s);


The nng_stream_close() function closes the byte stream s.

If any operations are pending, such as nng_stream_send() or nng_stream_recv(), they will be terminated with an NNG_ECLOSED error condition. Also, any new operations will fail with NNG_ECLOSED after the connection is closed.

Closing the connection while data is in transmission will likely lead to loss of that data. There is no automatic linger or flush to ensure that the socket send buffers have completely transmitted.
Closing the connection does not free the resources associated with it. Once it is certain that no more operations are pending on the connection, it should be freed with nng_stream_free().





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.