libssh2_session_set_timeout(3)

πŸ“¦
version 1.11.1 Β· 3 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, debian trixie, epel 10, epel 9, fedora 43, fedora 44, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’… libssh2_session_set_timeout(3) β€” the libssh2 girlies' guide

okay bestie, welcome to the libssh2 manual, section 3 (that's the library-functions girlies, iykyk). this one's about telling your blocking calls to stop waiting around like it's a group chat where nobody replies. ✨


🌸 NAME 🌸

libssh2_session_set_timeout β€” set the timeout for blocking functions, no cap πŸ•


πŸŽ€ SYNOPSIS πŸŽ€

#include <libssh2.h>

void
libssh2_session_set_timeout(LIBSSH2_SESSION *session, long timeout);

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe: you're setting the timeout in milliseconds for how long a blocking libssh2 function call is allowed to just... sit there. like, it can wait, but only for so long before it's like "okay this is giving nothing" and decides the whole situation is an error, returning LIBSSH2_ERROR_TIMEOUT. πŸ’€

fr fr, that's the whole thing: blocking calls get a deadline, and once they blow past it, they bail out with that error code instead of waiting forever.

and here's the default tea, bestie: by default β€” or if you set the timeout to zero β€” libssh2 has no timeout for blocking functions. like, zero patience settings, infinite patience behavior. she will simply wait. forever. no thoughts, head empty, just vibes. πŸ™ˆ

ngl, that default is main character energy in the worst way β€” if you don't set a timeout, your blocking calls are gonna commit to the bit indefinitely. set it if you want boundaries. 🫢

⭐ RETURN VALUE ⭐

Nothing. literally nothing. she does the thing and returns void. no value, no drama, just vibes. πŸ’…


🌈 AVAILABILITY 🌈

Added in 1.2.9. so if you're on something older, this function said "not me showing up" and you're out of luck. 😭


πŸ‘‘ SEE ALSO πŸ‘‘

  • libssh2_session_get_timeout(3) β€” the sister function, for when you wanna read the timeout instead of setting it. obsessed with the symmetry honestly. ✨

libssh2 Β· 4 May 2011 Β· mwah, that's the page bestie, go set some timeouts and slay πŸ’–πŸ¦‹πŸŽ€