Skip to main content

rt_connect

Description

The rt_connect function is used to attempt to establish an RTTP connection with a remote endpoint. The connection status will be notified via a callback function.

Syntax:

int rt_connect(RTEngine engine, RTSOCKET s, const struct sockaddr *to, int tolen);

Parameters:

engine: The pointer to the RTTP engine instance returned by rt_init().

s: The descriptor of an unconnected RTTP socket, created by rt_socket().

to: A pointer to the remote destination address. RTTP will save this address and pass it back when calling the send_data_callback to send data.

tolen: The length (in bytes) of the address data.

Return Value:

Returns 0 when a connection request is successfully initiated; returns an error code on failure.