NNG_HTTP_CONN_WRITE_ALL(3http)
π NNG_HTTP_..._WRITE_ALL(3http) π
hey bestie, welcome to the NNG Reference Manual, section 3http π this is the page for nng_http_conn_write_all, and yes, we're gonna get you comfy with it.
πΈ NAME πΈ
nng_http_conn_write_all β write all to HTTP connection, periodt π
β¨ SYNOPSIS β¨
#include <nng/nng.h>
#include <nng/supplemental/http/http.h>
void nng_http_conn_write_all(nng_http_conn *conn, nng_aio *aio);
π DESCRIPTION π
okay so nng_http_conn_write_all() starts an asynchronous write to the HTTP connection conn, into the scatter/gather vector located in the asynchronous I/O structure aio. slay.
π¨ Note, bestie: thenng_aio_set_iov()function must have been called first, to set the scatter/gather vector foraio. no skipping steps, okay? π«Ά
This function returns immediately, with no return value. Completion of the operation is signaled via the aio, and the final result may be obtained via nng_aio_result(). That result will either be zero or an error code.
The I/O operation completes only when the entire amount of data requested has been written, or an error has occurred. If the operation completes successfully, then the entire requested data has been written. iconic behavior honestly β¨
It is still possible for a partial write to complete in the event of an error. The actual number of bytes written can be determined with nng_aio_count(). keep that in your back pocket π
π‘ Tip: the main purpose for this function is to facilitate writing HTTP body content.
π‘ Tip: usually an HTTP request or response will have been written immediately prior to this withhttp_conn_write_req()orhttp_conn_write_res(). In that case the request or response should have also contained anContent-Lengthheader, and possibly aContent-Typeheader.
π‘ Tip: an easier solution to sending HTTP content data, is to include the content with the request or reply using a function likenng_http_req_copy_data(). In that case, the body data will be written automatically by thehttp_conn_write_req()orhttp_conn_write_res()function. efficiency queen π
π RETURN VALUES π
None. literally none. that's the whole vibe π«§
π¦ ERRORS π¦
NNG_ECANCELEDβ the operation was canceled.NNG_ECLOSEDβ the connection was closed.NNG_ECONNRESETβ the peer closed the connection.NNG_EINVALβ theaiodoes not contain a valid scatter/gather vector.NNG_ENOMEMβ insufficient free memory to perform the operation.NNG_ENOTSUPβ HTTP operations are not supported.NNG_ETIMEDOUTβ timeout waiting for data from the connection.
π SEE ALSO π
nng_aio_alloc(3)nng_aio_count(3)nng_aio_result(3)nng_aio_set_iov(3)nng_http_client_connect(3http)nng_http_conn_write(3http)http_conn_write_req(3http)http_conn_write_res(3http)nng_http_req_copy_data(3http)nng_http_req_set_data(3http)nng_http_res_copy_data(3http)nng_http_res_set_data(3http)nng_strerror(3)nng(7)
source/version: NNG Reference Manual π¦ Β· date: 2026-01-13 Β· mwah π
π¦ where this page comes from
- alpine 3.24: nng-doc 1.11-r0 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms