Skip to main content

rt_socket

Description

The rt_socket function is used to create an RTTP socket. Different transmission modes can be specified to adapt to the requirements of various application scenarios.

Syntax:

RTSOCKET rt_socket(RTEngine engine, int mode);

Parameters:

engine: The pointer to the RTTP engine instance returned by rt_init(). mode: The working mode of the RTTP socket; currently supports the following two modes:

  • RTSM_LOW_LATENCY: Low-latency mode, suitable for latency-sensitive applications such as online games and real-time audio/video.
  • RTSM_HIGH_THROUGHPUT: High-throughput mode, suitable for scenarios requiring high throughput like file transfer. This mode is currently unavailable in the current version.

Return Value:

Returns a valid RTTP socket descriptor on success; returns NULL on failure.