IPX/SPX Programming Manual

Programming Using the Socket Interface
HP NonStop IPX/SPX Programming Manual528022-001
3-2
Nowait I/O
In most cases, the parameters for these calls are identical to those of the
corresponding waited calls, with the addition of extra parameters for NonStop Kernel
requirements. The exceptions to this rule are accept_nw2, recvfrom_nw,
send_nw2, sendto_nw, t_recvfrom_nw, and t_sendto_nw, which have different
sets of parameters.
After performing a nowait I/O operation, your program must check for the completion
with a call to the AWAITIOX procedure call.
The SPXII implementation, based on the reliable SPXII protocol, buffers data. A
program performing a nowait operation should call recvfrom_nw before calling
sendto_nw. This ensures that a recvfrom_nw call is waiting for the next message
received.
The examples in Figure 3-1 summarize the procedural differences between 4.3 BSD
UNIX nonblocking I/O and NonStop Kernel nowait I/O.
In 4.3 BSD UNIX, the application tests (polls) a socket (f1) with the select call to see if
the I/O activity, in this case receiving data, can occur on the socket. If the socket can
receive data, the application executes the recv call; otherwise, the application
continues processing, and then executes the select call to poll the socket again.
In the NonStop Kernel environment, the application issues the recv_nw call on a
socket (f1) to attempt to receive data on a socket. The application continues
processing, and then calls AWAITIOX to determine if the recv_nw call has completed.
Figure 3-1. 4.3 BSD UNIX Nonblocking I/O Compared to Guardian Nowait I/O
VST0301.vsd
Continue
Processing
Process
recv_nw
Request
AWAITIOX(f1,...);
Continue
Processing
Continue
Process Execution
select(f1,...);
Process Execution I/O
Execution
recv_nw(f1,...)
True
False
recv(f1,...)
Process
recv(f1,...)
Request
I/O
Execution
BSD 4.3 UNIX
Nonblocking I/O using select()
Nowait I/O
Guardian