NetIPC 3000/XL Programmer's Reference Manual (5958-8600)

Table Of Contents
126 Chapter3
NetIPC Intrinsics
Asynchronous I/O
Asynchronous I/O
In order to perform nowait (asynchronous) socket I/O on an HP 3000, a
process must use the MPE XL IOWAIT and IODONTWAIT intrinsics.
IOWAIT and IODONTWAIT behave in the same way except that, in the
first case, the calling process must wait until the I/O operation is
complete; in the second case, control is immediately returned to the
calling process. One of these intrinsics must be called at some point
after a nowait I/O request. The calling process is not blocked after the
initial nowait I/O request.
IPCSEND, IPCRECV, and IPCRECVCN are normally blocking calls. The
calling process must wait until the send/receive request is completed. A
process can use IPCCONTROL to enable nowait I/O for a specified call
socket or VC socket descriptor. (Nowait mode remains in effect until
another IPCCONTROL call restores waited mode.) If a process issues a
nowait send or receive request, the request will be initiated but its
completion cannot be verified until IOWAIT or IODONTWAIT is called. (For
a nowait IPCRECVCN call, the data structures for the connection are not
created until IOWAIT is called.) IPCCONNECT is always an unblocked call:
control returns immediately to the calling process, which must then call
IPCRECV to complete the connection.
Within the IOWAIT/IODONTWAIT intrinsic, the
filenum
parameter
should be given the appropriate call socket/VC socket descriptor value.
A value of zero indicates all sockets or files for which asynchronous I/O
requests have been issued. The function value returned by the intrinsic
is the descriptor (or file number) for which the I/O has completed (zero
if no completion).
The
cstation
(calling station) parameter returns a zero value for any
nowait receive request. For a nowait send request, bit one of the
parameter (the second highest bit) is set to on (all other bits off).
Therefore you can check bit one of the
cstation
parameter to
determine whether an input or an output operation completed.
The
tcount
parameter returns the amount of data received after a
nowait IPCRECV call. The target parameter is not currently used by
NetIPC.
The syntax for IOWAIT and IODONTWAIT is given here for convenience.
For further information on these intrinsics, please see the MPE XL
Intrinsics Reference Manual.