libssh2_keepalive_config(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_keepalive_config(3) πŸ’–

okay bestie, welcome to the libssh2 manual β€” this one's about keeping your connection alive so it doesn't ghost you mid-conversation 😭


✨ NAME ✨

libssh2_keepalive_config β€” short function description


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <libssh2.h>

void
libssh2_keepalive_config(LIBSSH2_SESSION *session,
                         int want_reply,
                         unsigned int interval);

🌸 DESCRIPTION 🌸

So this function is literally the one that decides how often keepalive messages get sent. Think of it as setting the "hey u still there??" text cadence for your SSH session. πŸ’…

  • want_reply β€” tells you whether the keepalive messages should ask the server for a response. so like, do you want them to answer back or are you just sending vibes into the void 🫢
  • interval β€” the number of seconds that can pass without any I/O before a keepalive goes out. if you pass 0 (the default), keepalives are just off, disabled, not happening, periodt.
🚨 okay important: to dodge some busy-loop corner-cases, if you specify an interval of 1, it gets treated as 2. so 1 is lowkey a lie. it's giving 2. no cap.

Also bestie, heads up: non-blocking applications are responsible for sending the keepalive messages themselves using libssh2_keepalive_send(3). this function only configures it β€” it does not do the sending for you. you're the main character here, you have to actually do the thing ✨


πŸŽ€ RETURN VALUE πŸŽ€

Nothing. that's it. void. it returns nothing at all, it just sets the vibe and leaves πŸ’€


⭐ AVAILABILITY ⭐

Added in libssh2 1.2.5 πŸ‘‘


🌈 SEE ALSO 🌈


that's the whole page bestie, go keep those connections alive πŸ¦‹βœ¨

this was the libssh2 manual, libssh2_keepalive_config(3), dated 12 Apr 2011 β€” slay, obsessed, bye πŸ’–πŸ‘‘