NNG_HTTP_CONN_WRITE(3http)
okay so bestie, this is the manual page for nng_http_conn_write(3http) from the NNG Reference Manual, and it's literally about writing to an HTTP connection. it's giving async I/O main-character energy, and we're gonna get through every single detail together β¨π«Ά
π NAME π
nng_http_conn_write β write to HTTP connection. that's the whole vibe π
β¨ SYNOPSIS β¨
#include <nng/nng.h>
#include <nng/supplemental/http/http.h>
void nng_http_conn_write(nng_http_conn *conn, nng_aio *aio);
π DESCRIPTION π
The nng_http_conn_write() function starts an asynchronous write to the HTTP connection conn from the scatter/gather vector located in the asynchronous I/O structure aio. slay, it's async β¨
β οΈ Note:nng_aio_set_iov()must have been called first, to set the scatter/gather vector foraio. like, that's the setup requirement, bestie β no cap π«Ά
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. periodt π
The I/O operation completes as soon as at least one byte has been written, or an error has occurred. Therefore, the number of bytes written may be less than requested. The actual number of bytes written can be determined with nng_aio_count(). so yes, partial writes are a thing β don't assume it wrote the whole requested amount, bestie π
π‘ Tip: This function is intended to facilitate use cases that involve changing the protocol from HTTP, such as WebSocket. Most applications will never need to use this function. iykyk π¦
πΈ RETURN VALUES πΈ
None. literally no return value from this function, bestie β the result comes through the aio β¨
π¦ 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 π
go read these next, bestie, they're iconic π
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_all(3http)nng_http_handler_alloc(3http)nng_strerror(3)nng(7)
xoxo, bestie π source/version: NNG_HTTP_CONN_WRITE(3http) from the NNG Reference Manual, dated 2026-01-13. bye and slay β¨π«Ά
π¦ 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