libssh2_session_block_directions(3)
β¨ libssh2_session_block_directions β¨
okay bestie, so this is a page from the libssh2 manual β yes, the whole thing lives under that name β and today we're talking about libssh2_session_block_directions(3). it's giving "which way do i even wait" energy and honestly? kinda iconic. π
πΈ NAME πΈ
libssh2_session_block_directions β get directions to wait for π§
π¦ SYNOPSIS π¦
#include <libssh2.h>
int
libssh2_session_block_directions(LIBSSH2_SESSION *session);
π DESCRIPTION π
sessionβ a Session instance, exactly the kind you get back fromlibssh2_session_init_ex(3). no substitutions, bestie. π«Ά
so here's the tea: whenever any of the libssh2 functions hands you back LIBSSH2_ERROR_EAGAIN, that's your cue to go wait on the socket until it's got data ready to read or ready to write. π
and like, which one?? read? write? both?? that's literally the whole question this function answers. based on what libssh2_session_block_directions(3) gives back, you wait for read, for write, or for both. no guessing, no vibes-based socket polling. periodt. β¨
π RETURN VALUE π
it returns the set of directions as a binary mask, and it can be a combination of these two:
LIBSSH2_SESSION_BLOCK_INBOUNDβ the inbound direction is blocked. π§LIBSSH2_SESSION_BLOCK_OUTBOUNDβ the outbound direction is blocked. π§
the move is: wait for data to be available on the socket before you call a libssh2 function again. fr fr, don't skip that part. π
- if
LIBSSH2_SESSION_BLOCK_INBOUNDis set, thenselectshould contain the session socket in thereadfdsset. π - and correspondingly, if
LIBSSH2_SESSION_BLOCK_OUTBOUNDis set, thewritefdsset should contain the socket. βοΈ
π AVAILABILITY π
Added in 1.0 β so she's been here a minute, lowkey a legend. β
heads up: get thereadfds/writefdsthing backwards and you'll just be sitting there waiting on the wrong direction forever. not a slay. double-check that mask. π
and that's the whole page, bestie!! this lil manual entry comes to you from the libssh2 manual, dated 1 Oct 200 (yes, that's literally what it says β we keep the receipts exactly as they are π), and it's signed off by libssh2 itself. go forth and wait on the correct socket. mwah. π
ππ¦
π¦ where this page comes from
- alpine 3.22: libssh2-doc 1.11.1-r3 Β· BSD-3-Clause
- alpine 3.23: libssh2-doc 1.11.1-r4 Β· BSD-3-Clause
- alpine 3.24: libssh2-doc 1.11.1-r4 Β· BSD-3-Clause
- arch rolling: libssh2 1.11.1-7 Β· BSD-3-Clause
- debian trixie: libssh2-1-dev 1.11.1-1+deb13u1 Β· BSD3
- debian trixie: libssh2-1-dev 1.11.1-1+deb13u2 Β· BSD3
- epel 10: libssh2-docs 1.11.1-9.el10_3 Β· BSD-3-Clause
- epel 9: libssh2-docs 1.11.1-9.el9 Β· BSD-3-Clause
- fedora 43: libssh2-docs 1.11.1-4.fc43 Β· BSD-3-Clause
- fedora 43: libssh2-docs 1.11.1-9.fc43 Β· BSD-3-Clause
- fedora 44: libssh2-docs 1.11.1-5.fc44 Β· BSD-3-Clause
- fedora 44: libssh2-docs 1.11.1-9.fc44 Β· BSD-3-Clause
- opensuse-leap 16.0: libssh2-devel 1.11.1-160000.5.1 Β· BSD-3-Clause
- opensuse-leap 16.0: libssh2-devel 1.11.1-160000.5.1 Β· BSD-3-Clause
- opensuse-leap 16.0: libssh2-devel 1.11.1-160000.5.1 Β· BSD-3-Clause
- opensuse-leap 16.0: libssh2-devel 1.11.1-160000.5.1 Β· BSD-3-Clause
- ubuntu questing: libssh2-1-dev 1.11.1-1build1
- ubuntu questing: libssh2-1-dev 1.11.1-1ubuntu0.25.10.2
- ubuntu resolute: libssh2-1-dev 1.11.1-1build2 Β· BSD3
- ubuntu resolute: libssh2-1-dev 1.11.1-1ubuntu0.26.04.4 Β· BSD3
- ubuntu stonking: libssh2-1-dev 1.11.1-6 Β· BSD3
- π the page's license: BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms