man3tcp/RecvRecAsync

Table of Contents

Name

RecvRecAsync - async, receive a TRANS record

Description

RecvRecAsync

The first time RecvRecAsync is called for a new message it attempts to receive as much of an encapsulated TRANS record from the file descriptor as possible.

If it receives the entire message it decapsulates the message into the TRANS structure and returns 0.

If the entire message wasn’t received it returns 1 and expects the program to call it again when select() indicates the file descriptor is ready with new data.

Each subsequent call attempts to read more of the message until the entire message is received. When the entire message is received it decapsulates the message into the TRANS structure and returns 0.

Use of RecvRecAsync must be preceeded by a call to InitRecvRecAsync in order to create the opaque data structure used by RecvRecAsync(). This call must be made for each I/O channel to be used.

This function is part of libtcp.

Syntax

char *InitRecvRecAsync(void);

int RecvRecAsync(
   int fi,

   TRANS *Tr,

   int verbosity

   );

Arguments

fi

socket file descriptor

Tr

pointer to TRANS record to place data in.

verbosity

This is supposed to be used to control the emission of error messages from the function. It was added at the same time as a SendRec() was modified, however at this time (08-14-2008) it does nothing.

Returns

-1 - i/o error
0 - if no more work
1 - busy

See Also

libtcp(3tcp)

Manual page revision

$Id: RecvRecAsync.3,v 1.1 2008/08/22 18:29:21 kitchen Exp $


Table of Contents