QsoStartRecv()--Start Asynchronous Receive Operation


  Syntax
 #include <qsoasync.h>

 int QsoStartRecv (int socketDescriptor,int IOCompletionPort,
 Qso_OverlappedIO_t * communicationsArea)

        

  Service Program Name: QSOSRV3

  Default Public Authority: *USE

  Threadsafe: Yes

The QsoStartRecv function is used to initiate an asynchronous receive operation. The supplied buffer cannot be reused by the calling application until the receive is complete or the I/O completion port specified on the QsoStartRecv has been destroyed. This API only supports sockets with an address family of AF_INET or AF_INET6 and type SOCK_STREAM.


Parameters

int socketDescriptor (Input)
The socket descriptor that should be used to receive data into the specified buffer.

int IOCompletionPort (Input)
The I/O completion port that should be posted when the operation completes.

Qso_OverlappedIO_t * communicationsArea (Input/Output)
A pointer to a structure that contains the following information:


Authorities

No authorization is required.


Return Values

QsoStartRecv() returns an integer. Possible values are:


Errno Conditions

When QsoStartRecv() fails, errno can be set to one of the following:

Note: The rest of the errno values from recv() also apply to QsoStartRecv().


Error Messages



Usage Notes

  1. If QsoStartRecv() partially fills a buffer and then encounters an EFAULT condition, the QsoStartRecv() will complete with the ETRUNC error value to indicate that some data has been lost.

  2. A buffer that is given to QsoStartRecv() must not be used by the application again until either it is returned by QsoWaitForIOCompletion() or is reclaimed by issuing a close() on the socket descriptor or issuing a QsoDestroyIOCompletionPort() on the I/O completion port. If a buffer is given to QsoStartRecv() to be filled, and it is later detected during QsoStartRecv processing that the buffer has been freed, it may produce an unrecoverable condition on the socket for which the QsoStartRecv() was issued. If this occurs, an ECONNABORTED error value will be returned.

  3. It is not recommended to intermix QsoStartRecv() and blocking I/O (that is, recv()) on the same socket. If this condition occurs, then pending asynchronous send I/O will be serviced first before the blocking I/O.

  4. Socket option SO_RCVLOWAT is not supported by this API. Semantics similar to SO_RCVLOWAT can be obtained using the fillBuffer field in the Qso_OverLappedIO_t structure.

  5. Socket option SO_RCVTIMEO is not supported by this API. Semantics similar to SO_RCVTIMEO can be obtained using the operationWaitTime field in the Qso_OverLappedIO_t structure.

Related Information



API introduced: V5R1