NNG_HTTP_CONN_WRITE(3http)

πŸ“¦ version 1.11, in alpine 3.24

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 for aio. 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 β€” the aio does 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 πŸ‘‘


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