stream_receive_ubyte stream_receive_ubyte_array navigation bar

Table of Contents

stream_receive_ubytes

Receives an array of unsigned bytes over a client stream.

Description

This function receives an array of unsigned bytes over a client stream. It has the same semantics as the stream_receive function.

Unlike the stream_receive_ubyte_array function, this function does not require that the stream receive buffer be at least num_elements bytes in length. Hence, it allow smaller stream buffers to be used.

Prototype

t_int
stream_receive_ubytes(t_stream stream, t_ubyte * elements, t_uint num_elements);

    

Parameters

t_stream stream

A client stream established using stream_connect or stream_accept.

t_ubyte * elements

A pointer to a t_ubyte array in which the received data will be stored.

t_uint num_elements

The number of elements to receive, and available in the elements array.

Return value

The number of bytes received, which may be less than the requested number of bytes for non-blocking streams. If no more data is available and the connection has been closed gracefully then 0 is returned. If an error occurs then a negative error code is returned.

Error codes

This function does not return any error code.

Requirements

Include Files

Libraries

quanser_stream.h

quanser_communications.lib;quanser_runtime.lib;quanser_common.lib

See Also

 

navigation bar