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 Name | Type | Meaning |
|---|---|---|
RTSO_MTU | int32 | Maximum Transmission Unit (MTU) |
RTSO_FEC | int32 | Whether Forward Error Correction (FEC) is enabled |
RTSO_FAST_ACK | int32 | Whether Fast Acknowledgment mechanism is enabled |
RTSO_RCVBUF | int32 | Maximum receive buffer size of the RTTP socket |
RTSO_RTT | int64 | Round-Trip Time (RTT) in microseconds |
RTSO_LOST_RATE | int32 | Overall packet loss percentage since connection |
RTSO_RECENT_LOST_RATE | int32 | Packet 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.