libssh2\_session\_startup(3) libssh2 libssh2\_session\_startup(3)

# [NAME](#NAME)

libssh2\_session\_startup - begin transport layer

# [SYNOPSIS](#SYNOPSIS)

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

# [DESCRIPTION](#DESCRIPTION)

Starting in libssh2 version 1.2.8 this function is considered deprecated. Use [*libssh2\_session\_handshake(3)*](/man/os/libssh2/libssh2_session_handshake.3) instead.

*session* - Session instance as returned by [**libssh2\_session\_init\_ex(3)**](/man/os/libssh2/libssh2_session_init_ex.3)

*socket* - Connected socket descriptor. Typically a TCP connection though the protocol allows for any reliable transport and the library will attempt to use any berkeley socket.

Begin transport layer protocol negotiation with the connected host.

# [RETURN VALUE](#RETURN_VALUE)

Returns 0 on success, negative on failure.

# [ERRORS](#ERRORS)

*LIBSSH2\_ERROR\_SOCKET\_NONE* - The socket is invalid.

*LIBSSH2\_ERROR\_BANNER\_SEND* - Unable to send banner to remote host.

*LIBSSH2\_ERROR\_KEX\_FAILURE* - Encryption key exchange with the remote host failed.

*LIBSSH2\_ERROR\_SOCKET\_SEND* - Unable to send data on socket.

*LIBSSH2\_ERROR\_SOCKET\_DISCONNECT* - The socket was disconnected.

*LIBSSH2\_ERROR\_PROTO* - An invalid SSH protocol response was received on the socket.

*LIBSSH2\_ERROR\_EAGAIN* - Marked for non-blocking I/O but the call would block.

# [SEE ALSO](#SEE_ALSO)

[**libssh2\_session\_free(3)**](/man/os/libssh2/libssh2_session_free.3) [**libssh2\_session\_init\_ex(3)**](/man/os/libssh2/libssh2_session_init_ex.3)

1 Jun 2007 libssh2 0.15

---

Document: libssh2_session_startup(3) from libssh2 1.11.1-r11 (Chainguard OS)
Source: https://github.com/libssh2/libssh2.git
