gnutls_record_get_direction(3)
π gnutls_record_get_direction(3) π
okay bestie, welcome to the gnutls section 3 manual, this one's about gnutls_record_get_direction and it's genuinely so useful once you get the vibe β¨
πΈ NAME πΈ
gnutls_record_get_direction β it's an API function, and it tells you which way the data was tryna go π
π¦ SYNOPSIS π¦
#include <gnutls/gnutls.h>
int gnutls_record_get_direction(gnutls_session_t session);
π ARGUMENTS π
gnutls_session_t sessionβ bestie, it's agnutls_session_ttype. that's the whole thing. it's your session. π
β¨ DESCRIPTION β¨
so like, this function is the moment when you need to know whether a GnuTLS function got interrupted while it was sending or while it was receiving, so you can call select() or poll() the right way. it's giving "which one do i wait on" energy π«Ά
it spills the tea about the internals of the record protocol, so it's only useful if a previous gnutls function call β like gnutls_handshake(), for example β got interrupted and returned GNUTLS_E_INTERRUPTED or GNUTLS_E_AGAIN. after an interrupt like that, your app can call select() or poll() before it goes back to restoring the interrupted GnuTLS function. icon behaviour, honestly π
β οΈ ok important though: this function's output is unreliable if you're using the same session in different threads for sending and receiving. like, do not do that and then trust the answer. not me warning you twice π
π RETURNS π
0β it got interrupted while trying to read data π1β it got interrupted while trying to write data βοΈ
that's it, that's the whole return value situation, no cap π
π REPORTING BUGS π
found a bug? spill it to <bugs@gnutls.org> π
home page: https://www.gnutls.org π
π COPYRIGHT π
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. slay, that's the license, go forth and redistribute π
β 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 here instead:
https://www.gnutls.org/manual/
and that's the whole page!! this was gnutls version 3.8.13 btw, from the gnutls peeps β mwah, take care of your sessions and don't share them across threads for send + recv, ily bye π
β¨π¦
π¦ where this page comes from
- alpine 3.22: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.23: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- alpine 3.24: gnutls-doc 3.8.13-r0 Β· LGPL-2.1-or-later
- arch rolling: gnutls 3.8.13-3 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 43: gnutls-devel 3.8.13-1.fc43 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- fedora 44: gnutls-devel 3.8.13-1.fc44 Β· GPL-3.0-or-later AND LGPL-2.1-or-later
- ubuntu stonking: gnutls-doc 3.8.13-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms