libssh2_keepalive_send(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_send(3) πŸ’–

okay bestie, this one lives in the libssh2 manual, and it's the little heartbeat-check function that keeps your SSH connection from ghosting you. yes, that's a thing. it's giving "u up?" but for sockets. πŸ¦‹


✨ NAME ✨

libssh2_keepalive_send β€” short function description

ngl the original manpage literally just says "short function description" and honestly? iconic of them. anyway. sending keepalives. that's the vibe. πŸ’…

🌸 SYNOPSIS 🌸

#include <libssh2.h>

int
libssh2_keepalive_send(LIBSSH2_SESSION *session,
                       int *seconds_to_next);

πŸŽ€ DESCRIPTION πŸŽ€

Send a keepalive message if needed. that "if needed" is doing a lot of heavy lifting, so pay attention bestie.

seconds_to_next is a pointer, and after the call it'll tell you how many seconds you can sleep after this call before you need to call it again. so it's basically the function tapping you on the shoulder like "hey. hey. set a timer. i'll need you again in this many seconds." ⏰✨


πŸ”₯ RETURN VALUE πŸ”₯

Returns 0 on success, or LIBSSH2_ERROR_SOCKET_SEND on I/O errors. so if it's not 0, something went sideways on the socket send and you should go check on that. πŸ’€


πŸ‘‘ AVAILABILITY πŸ‘‘

Added in libssh2 1.2.5 β€” a true vintage queen, been around since forever fr fr. 🫢


🌈 SEE ALSO 🌈


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

this was brought to you by the libssh2 manual, 13 Apr 2011 β€” yes it's an oldie but she still slays. mwah. πŸŽ€