SendFully
Function Usage
Sends data to the peer end.
Restrictions
This function is an external symbol to be implemented in the communication module by secondary developers. The video stream engine calls this function to send data. The communication library must ensure that SendFully returns a result only after it has sent all the data transferred by the caller or when an error occurs. In addition, the communication library must support multi-thread exclusive call.
Prototype
ssize_t SendFully(int connection, uint8_t *buf, size_t len)
Parameters
Parameter |
Input/Output |
Class |
Description |
|---|---|---|---|
connection |
Input |
int |
Connection handle returned by OnNewConnectionCallback |
buf |
Input |
uint8_t * |
Memory pointer that points to the data to be sent. |
len |
Input |
size_t |
Length of the data to be sent. The size cannot exceed 64 KB. |
Returns
Data type: ssize_t
The value can be:
- > 0: Number of sent bytes
- -3: Invalid parameter. For example, the connection handle is invalid, buf is null, or len is 0.
- -4: The connection is interrupted.