gnutls_system_recv_timeout(3)

✨ gnutls_system_recv_timeout(3) ✨

okay bestie, welcome to the gnutls manual, section 3 (that's the library-functions section, iykyk πŸ’…). today's episode: gnutls_system_recv_timeout, which is lowkey just "hey, is there data yet?" but make it timed. 🌸


πŸŽ€ NAME πŸŽ€

gnutls_system_recv_timeout β€” it's an API function, and it's here to do exactly one thing and do it well. πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <gnutls/gnutls.h>

int gnutls_system_recv_timeout(gnutls_transport_ptr_t ptr, unsigned int
ms);

yes that's the whole thing. she's compact. she's iconic. πŸ’–


🌈 ARGUMENTS 🌈

  • gnutls_transport_ptr_t ptr β€” a file descriptor, except it's wrapped up all cozy in a gnutls_transport_ptr_t pointer. like a little gift. 🎁
  • unsigned int ms β€” the number of milliseconds to wait. that's the patience budget, bestie. ⏳

πŸ’œ DESCRIPTION πŸ’œ

so what she does is: she waits for data to be received from the socket you handed her (ptr), but only within a timeout period measured in milliseconds. and how does she wait? she uses select() on the ptr you gave her. no cap. 🫢

she's not out here being a whole transport by herself β€” she's a helper, a lil assist, for when you're building your own custom callbacks for gnutls_transport_set_pull_timeout_function(). you'd reach for her if you're the kind of person who relies on socket file descriptors. socket-fd girlies, this one's for you. πŸ”₯

and the return values? here's the vibe check:

  • returns -1 on error 😭
  • returns 0 on timeout πŸ’€
  • returns a positive value if data are available for reading ✨

⭐ SINCE ⭐

3.4.0 β€” she's been around a minute. a veteran. a legend. πŸ‘‘


πŸ™ˆ REPORTING BUGS πŸ™ˆ

found a bug? don't be shy, report it to <bugs@gnutls.org>. πŸ“§

Home page: https://www.gnutls.org β€” go say hi. 🌐


Copyright Β© 2001-2023 Free Software Foundation, Inc., and others.

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. (translation: share her freely, just keep the receipts. periodt. πŸ’…)


🧚 SEE ALSO 🧚

the full documentation for gnutls is maintained as a Texinfo manual. if the /usr/share/doc/gnutls/ directory does not contain the HTML form, then bestie, go visit:

https://www.gnutls.org/manual/

that's the mothership. the main character documentation. go read her. πŸ“šβœ¨


and that's the whole page, bestie!! this was gnutls 3.8.13, gnutls_system_recv_timeout(3), brought to you by the gnutls crew. mwah. πŸ’–πŸ¦‹πŸŽ€

πŸ“¦ where this page comes from