a0ReceiveBuffer()

Performs a blocking receive with a buffer.


Syntax

a0tError a0ReceiveBuffer(
a0tPort *port,
int source,
int tag,
a0tRequest *request,
a0tBuffer *buffer );

Arguments

Namerd/wrDescription
port read Port to listen to (on caller's node).
source read Source node to listen to.
tag read tag to use.
request write Request descriptor to hold the status.
buffer write Receive buffer.

Description

This function performs a blocking receive on a given port port, from a given source node source (or A0AnySource if any node will do), with a given tag tag. It blocks the calling thread to receive data into the buffer buffer.

The full contents of a buffer is replaced every time a receive is performed. There is no need to call a0ClearBuffer() prior to receive it.

On return of this function, the variable pointed by request contains an opaque request that can be used later to check the completion status of the receive operation.


Return Values

If an error condition occurs, it returns the error code, otherwise it returns A0ErrOk. Possible values are as follows:
Error CodeDescription
A0Err...Some error occurred.
A0ErrOkSuccessful completion.

See Also

a0IReceiveBuffer() a0Receive() a0IReceive() a0SendBuffer() a0Pack() a0Unpack()