#include <qsoasync.h> int QsoStartRecv (int socketDescriptor,int IOCompletionPort, Qso_OverlappedIO_t * communicationsArea)
The QsoStartRecv function is used to initiate a 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.
descriptorHandle | (Input) - The descriptor handle is application specific and is never used by the system. This field is intended to make it easier for the application to keep track of information regarding a given socket connection. |
buffer | (Input) - A pointer to a buffer into which data should be read. |
bufferLength | (Input) - The length of the buffer into which data should be read. Also represents the amount of data requested. |
postFlag | (Input) - The postFlag indicates if this
operation should be posted to the I/O completion port even if it completes
immediately.
|
postFlagResult | (Output) - This field is valid if QsoStartRecv() returns with 1 and postFlag was set to 1. In this scenario, postFlagResult set to 1 denotes the operation completed and been posted to the I/O completion port specified. A value of 0 denotes the operation could not be completed immediately, but will be handled asynchronously. |
fillBuffer | (Input) - The fillBuffer flag indicates when this operation should complete. If the fillBuffer flag is 0, then the operation will complete as soon as any data is available to be received. If the fillBuffer flag is non-zero, this operation will not complete until enough data has been received to fill the buffer, an end-of-file condition occurs on the socket, or an error occurs on a socket. |
returnValue | (Output) - When QsoStartRecv() completes synchronously (function return value equals 0), then this field indicates the number of bytes that were actually received. When the recv operation completes asynchronously, this field contains indication of success or failure. Zero returned denotes end-of-file state. |
errnoValue | (Output) - When the operation completes asynchronously and returnValue is negative, this field contains an errno to indicate the error with which the operation eventually failed. |
operationCompleted | (Output) - If the operation is posted to the I/O completion port, this field is updated to indicate that the operation was a QsoStartRecv(). |
secureDataTransferSize | Not used. |
bytesAvailable | Not used. |
operationWaitTime | (Input) - A timeval structure which specifies the
maximum time allowed for this operation to complete asynchronously.
struct timeval { long tv_sec; /* second */ long tv_usec; /* microseconds */ }; If this timer expires, the operation will be posted to the I/O completion port with errnoValue set to EAGAIN. If this field is set to zero, the operation's asynchronous completion will not be timed. If socketDescriptor is closed before the operation completes or times out, the operation will be posted to the I/O completion port with errnoValue set to ECLOSED. The minimum operationWaitTime is 1 second. The microseconds field (tv_usec) in the timeval is not used and must be set to zero. |
postedDescriptor | Not used - Must be set to zero. |
reserved1 | (Input) - Must be set to hex zeroes. |
reserved2 | (Input) - Must be set to hex zeroes. |
No authorization is required.
QsoStartRecv() returns an integer. Possible values are:
When QsoStartRecv() fails, errno can be set to one of the following:
[EINVAL] | A buffer length or I/O completion port or
reserved field specified was not valid or postedDescriptor was not zero or operationWaitTime.tv_sec
was negative or operationWaitTime.tv_usec was not zero. |
[ETRUNC] | Data was truncated on an input, output, or update operation. Data has been lost. |
Note: The rest of the errno values from recv() also apply to QsoStartRecv().
Message ID | Error Message Text |
---|---|
CPFA081 E | Unable to set return value or error code. |
CPE3418 E | Possible APAR condition or hardware failure. |
CPF9872 E | Program or service program &1 in library &2 ended. Reason code &3. |
Top | UNIX-Type APIs | APIs by category |