UDT Reference: CUDT Methods

recv

The recv method receives some size of data into a local memory buffer.

void recv(
   char* data,

   const int& len
);

Parameters

data
[in] The pointer to the application data block to receive the data.
len
[in] The length of data to be received.

Return Values

NONE.

Exceptions

A CUDTException exception can be threw out if the UDT entity is not connected or the connection has been broken, or the non-blocking receiving mode is used but there is not enough data in the UDT buffer.

Description

The recv method returns immediately if the UDT_RCVSYN is set to true. In such a case, an exception may arise if there is not enough data to be written into the buffer. Meanwhile, the content of the buffer is modified.

In blocking mode, the recv method waits until the buffer is fulfilled.

Zero or negative value is allowed for len. In such situation, the method returns immediately.

See Also

listen, connect, send