Skip to main content

rt_send

Description

The rt_send function is used to send data over a connected RTTP socket.

Syntax:

int rt_send(RTEngine engine, RTSOCKET s, const char * buffer, int len, int flag);

Parameters:

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

s: The connected RTTP socket descriptor.

buffer: A pointer to the buffer containing the data to be sent.

len: The length of the data to be sent (in bytes).

flag: A reserved parameter; currently should be set to 0.

Return Value:

  • When some or all data is successfully sent, it returns the actual number of bytes sent (may be less than the requested len value).
  • When data cannot be sent currently (send buffer is full), it returns -1. When the RTTP socket becomes writable, it will automatically trigger the RTTP_EVENT_WRITE event.
  • In case of an error, it returns a negative error code.