---
name: "libssh2_keepalive_send"
section: "3"
platform: "linux"
package: "libssh2"
version: "1.11.1-7"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libssh2_keepalive_send"
---

# libssh2\_keepalive\_send(3)

short function description

## NAME

libssh2\_keepalive\_send - short function description

## SYNOPSIS

```
#include <libssh2.h>
int
libssh2_keepalive_send(LIBSSH2_SESSION *session,
                       int *seconds_to_next);
```

## DESCRIPTION

Send a keepalive message if needed. **seconds\_to\_next** indicates how many seconds you can sleep after this call before you need to call it again.

## RETURN VALUE

Returns 0 on success, or LIBSSH2\_ERROR\_SOCKET\_SEND on I/O errors.

## AVAILABILITY

Added in libssh2 1.2.5

## SEE ALSO

**[libssh2\_keepalive\_config(3)](/libssh2_keepalive_config/3.md)**
