diff options
| author | Garrett D'Amore <garrett@damore.org> | 2025-01-01 19:11:54 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2025-01-01 19:11:54 -0800 |
| commit | f293e96b03b22c6a91140b118c4e15059e285543 (patch) | |
| tree | 1a7c333e6e5a4209831ab2e7aa8c2a43d98aa2e8 /docs/man/nng_ctx_send.3.adoc | |
| parent | f7bf24f429cbc488b861ab1b1e4cf1983af56295 (diff) | |
| download | nng-f293e96b03b22c6a91140b118c4e15059e285543.tar.gz nng-f293e96b03b22c6a91140b118c4e15059e285543.tar.bz2 nng-f293e96b03b22c6a91140b118c4e15059e285543.zip | |
docs: convert the context docs to mdbook
Diffstat (limited to 'docs/man/nng_ctx_send.3.adoc')
| -rw-r--r-- | docs/man/nng_ctx_send.3.adoc | 88 |
1 files changed, 0 insertions, 88 deletions
diff --git a/docs/man/nng_ctx_send.3.adoc b/docs/man/nng_ctx_send.3.adoc deleted file mode 100644 index 8724c1aa..00000000 --- a/docs/man/nng_ctx_send.3.adoc +++ /dev/null @@ -1,88 +0,0 @@ -= nng_ctx_send(3) -// -// Copyright 2018 Staysail Systems, Inc. <info@staysail.tech> -// Copyright 2018 Capitar IT Group BV <info@capitar.com> -// -// This document is supplied under the terms of the MIT License, a -// copy of which should be located in the distribution where this -// file was obtained (LICENSE.txt). A copy of the license may also be -// found online at https://opensource.org/licenses/MIT. -// - -== NAME - -nng_ctx_send - send message using context asynchronously - -== SYNOPSIS - -[source, c] ----- -#include <nng/nng.h> - -void nng_ctx_send(nng_ctx ctx, nng_aio *aio); ----- - -== DESCRIPTION - -The `nng_ctx_send()` sends a xref:nng_msg.5.adoc[message] using the -xref:nng_ctx.5.adoc[context] _ctx_ asynchronously. - -The message to send must have previously been set on the _aio_ -using the xref:nng_aio_set_msg.3.adoc[`nng_aio_set_msg()`] function. -The function assumes ownership of the message. - -If the message was successfully queued for delivery to the socket, -then the _aio_ will be completed, and xref:nng_aio_result.3.adoc[`nng_aio_result()`] -will return zero. -In this case the socket will dispose of the message when it is finished with it. - -NOTE: The operation will be completed, and the callback associated -with the _aio_ executed, as soon as the socket accepts the message -for sending. -This does _not_ indicate that the message was actually delivered, as it -may still be buffered in the sending socket, buffered in the receiving -socket, or in flight over physical media. - -If the operation fails for any reason (including cancellation or timeout), -then the _aio_ callback will be executed and -xref:nng_aio_result.3.adoc[`nng_aio_result()`] will return a non-zero error status. -In this case, the callback has a responsibility to retrieve the message from -the _aio_ with xref:nng_aio_get_msg.3.adoc[`nng_aio_get_msg()`] and dispose of -it appropriately. -(This may include retrying the send operation on the same or a different -socket, or deallocating the message with xref:nng_msg_free.3.adoc[`nng_msg_free()`].) - -NOTE: The semantics of what sending a message means varies from protocol to -protocol, so examination of the protocol documentation is encouraged. - -TIP: Context send operations are asynchronous. -If a synchronous operation is needed, one can be constructed by using a -`NULL` callback on the _aio_ and then waiting for the operation using -xref:nng_aio_wait.3.adoc[`nng_aio_wait()`]. - -== RETURN VALUES - -None. (The operation completes asynchronously.) - -== ERRORS - -[horizontal] -`NNG_ECANCELED`:: The operation was aborted. -`NNG_ECLOSED`:: The context _ctx_ is not open. -`NNG_EMSGSIZE`:: The message is too large. -`NNG_ENOMEM`:: Insufficient memory is available. -`NNG_ENOTSUP`:: The protocol for context _ctx_ does not support sending. -`NNG_ESTATE`:: The context _ctx_ cannot send data in this state. -`NNG_ETIMEDOUT`:: The send timeout expired. - -== SEE ALSO - -[.text-left] -xref:nng_aio_get_msg.3.adoc[nng_aio_get_msg(3)], -xref:nng_aio_set_msg.3.adoc[nng_aio_set_msg(3)], -xref:nng_msg_alloc.3.adoc[nng_msg_alloc(3)], -xref:nng_strerror.3.adoc[nng_strerror(3)], -xref:nng_aio.5.adoc[nng_aio(5)], -xref:nng_ctx.5.adoc[nng_ctx(5)], -xref:nng_msg.5.adoc[nng_msg(5)], -xref:nng.7.adoc[nng(7)] |
