Libssh2 channel forward listen ex

From Libssh2

LIBSSH2_LISTENER *libssh2_channel_forward_listen_ex(LIBSSH2_SESSION *session, char *host, int port, int *bound_port, int queue_maxsize);
#define libssh2_channel_forward_listen(session, port)
        libssh2_channel_forward_listen_ex((session), NULL, (port), NULL, 16)

About

Instruct the remote SSH server to begin listening for inbound TCP/IP connections. New connections will be queued by the library until accepted by libssh2_channel_forward_accept().

Parameters

  • session
    Session instance as returned by libssh2_session_init().
  • host
    Specific address to bind to on the remote host. Binding to 0.0.0.0 (default when NULL is passed) will bind to all available addresses.
  • port
    Port to bind to on the remote host. When 0 is passed, the remote host will select the first available dynamic port.
  • bound_port
    Populated with the actual port bound on the remote host. Useful when requesting dynamic port numbers.
  • queue_maxsize
    Maximum nuber of pending connections to queue before rejecting further attempts.

Returns

  • On Success
    Newly allocated Channel instance.
  • On Failure
    NULL