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.
int RecvRecAsync(
int fi,
TRANS *Tr,
int verbosity
);