NNG_STREAM_SEND(3str)

πŸ“¦ version 1.11, in alpine 3.24

🌸 NAME 🌸

okay bestie, welcome to NNG_STREAM_SEND(3str) from the NNG Reference Manual β€” this page is literally all about nng_stream_send, aka send to byte stream. no cap. πŸ’–

✨ SYNOPSIS ✨

#include <nng/nng.h>

void nng_stream_send(nng_stream *s, nng_aio *aio);

that’s the whole function signature, bestie β€” short and iconic. πŸŽ€

πŸ¦‹ DESCRIPTION πŸ¦‹

so the nng_stream_send() function starts an asynchronous send over the byte stream s from the scatter/gather vector located in the asynchronous I/O structure aio. it’s giving β€œfire and forget,” fr fr. πŸ”₯

⚠️ Note: the nng_aio_set_iov() function must have been called first, to set the scatter/gather vector for aio. don’t skip this step, bestie β€” it’s the vibe check for your I/O. πŸ’…

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 as soon as at least one byte has been sent, or an error has occurred. Therefore, the number of bytes sent may be less than requested. The actual number of bytes sent can be determined with nng_aio_count(). 🫢

πŸ’… RETURN VALUES πŸ’…

None. literally none. zero. the void. πŸ•³οΈβœ¨

😭 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_ETIMEDOUT β€” timeout waiting for data from the connection. ⏰

πŸ”₯ SEE ALSO πŸ”₯


mwah πŸ’‹ sign-off time: this cutie is the NNG_STREAM_SEND(3str) page from the NNG Reference Manual, dated 2026-01-13. go slay those byte streams, bestie. πŸŽ€πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from