libssh2_keepalive_config(3)

libssh2_keepalive_config3

Short function description

Usage

#include <libssh2.h>
void
libssh2_keepalive_config(LIBSSH2_SESSION *session,
                         int want_reply,
                         unsigned int interval);

Overview

Set how often keepalive messages should be sent. want_reply indicates whether the keepalive messages should request a response from the server. interval is number of seconds that can pass without any I/O, use 0 (the default) to disable keepalives. To avoid some busy-loop corner-cases, if you specify an interval of 1 it will be treated as 2.

Note that non-blocking applications are responsible for sending the keepalive messages using libssh2_keepalive_send(3).

Return value

Nothing

Releases

8 releases since Debian 7 (Wheezy); the text changed 1 time.

  1. 7–12
  2. 13–Arch

Availability

Added in libssh2 1.2.5

From libssh2 1.11.1-7 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.