Beispiel #1
0
int ssh_keepalive(ssh_conn_t *conn)
{
	int rc = 0;
	int sec = 0;
	rc = libssh2_keepalive_send(conn->session, &sec);
	sec = sec-1<0?0:sec-1;
	return rc<0 ? rc : sec;
}
Beispiel #2
0
static PyObject *
session_keepalive_send(SSH2_SessionObj *self)
{
	int seconds_to_next;
	int ret;

	ret = libssh2_keepalive_send(self->session, &seconds_to_next);

	CHECK_RETURN_CODE(ret, self)

	return Py_BuildValue("i", seconds_to_next);
}