Rate This Document
Findability
Accuracy
Completeness
Readability

Recv

Function Usage

Receives data from the peer end.

Restrictions

The video stream engine requires secondary developers to implement the communication module for sending and receiving data. This function is an external symbol to be implemented in the communication module by secondary developers. The video stream engine calls this function to receive data. This function must be called in blocking mode.

Prototype

ssize_t Recv(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 received data.

len

Input

size_t

Length of the memory for storing the received data. The size cannot exceed 64 KB.

Returns

Data type: ssize_t

The value can be:

  • > 0: Number of received data bytes
  • -1: No data is received. This function can be called again to receive data.
  • -2: The connection is interrupted.