summaryrefslogtreecommitdiff
path: root/docs/ref/str/nng_stream_close.adoc
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2024-04-08 20:18:34 -0700
committerGarrett D'Amore <garrett@damore.org>2024-04-08 20:18:34 -0700
commit1a66ecd1098d4d8e10806e32741acc35a6d08f8d (patch)
tree9b651cfd0d9d1fa2b316a3236eba7f2d264e3566 /docs/ref/str/nng_stream_close.adoc
parentc7f7bcb6e2cfbf66c7fab158b0ac02890243b5bb (diff)
downloadnng-doc-reorg.tar.gz
nng-doc-reorg.tar.bz2
nng-doc-reorg.zip
nng_stream_* converteddoc-reorg
Diffstat (limited to 'docs/ref/str/nng_stream_close.adoc')
-rw-r--r--docs/ref/str/nng_stream_close.adoc29
1 files changed, 29 insertions, 0 deletions
diff --git a/docs/ref/str/nng_stream_close.adoc b/docs/ref/str/nng_stream_close.adoc
new file mode 100644
index 00000000..c4afe8a7
--- /dev/null
+++ b/docs/ref/str/nng_stream_close.adoc
@@ -0,0 +1,29 @@
+## nng_stream_close
+
+Close byte stream.
+
+### Synopsis
+
+```c
+#include <nng/nng.h>
+
+void nng_stream_close(nng_stream *s);
+```
+
+### Description
+
+The `nng_stream_close` function closes the byte stream _s_.
+
+Any pending operations, as well as any further new operations, will fail with an `NNG_ECLOSED` error.
+
+NOTE: 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.
+
+NOTE: 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 xref:nng_stream_free.adoc[`nng_stream_free`].
+
+### See Also
+
+xref:nng_stream_free.adoc[nng_stream_free],
+xref:nng_stream_recv.adoc[nng_stream_recv],
+xref:nng_stream_send.adoc[nng_stream_send]