Skip to main content

rt_getsockopt

Description

The rt_getsockopt function is used to retrieve the current values of various parameters configured for an RTTP socket.

Syntax:

int rt_getsockopt(RTEngine engine, RTSOCKET s, int optname, void *optval, int optlen);

Parameters:

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

s: The RTTP socket descriptor.

optname: The name of the RTTP socket option to query.

Option NameTypeMeaning
RTSO_MTUint32Maximum Transmission Unit (MTU)
RTSO_FECint32Whether Forward Error Correction (FEC) is enabled
RTSO_FAST_ACKint32Whether Fast Acknowledgment mechanism is enabled
RTSO_RCVBUFint32Maximum receive buffer size of the RTTP socket
RTSO_RTTint64Round-Trip Time (RTT) in microseconds
RTSO_LOST_RATEint32Overall packet loss percentage since connection
RTSO_RECENT_LOST_RATEint32Packet loss percentage within the last 3 seconds

optval: A pointer to the buffer used to store the option value.

optlen: An input/output parameter, a pointer to an integer. As input, it indicates the maximum length of the optval buffer; as output, it indicates the actual length of the written option value.

Return Value:

Returns the length of the option value written to the optval buffer on success; returns a negative error code on failure.