IPX/SPX Programming Manual

Programming Using the Socket Interface
HP NonStop IPX/SPX Programming Manual528022-001
3-10
SPXII Client and Server Programs
The nowait versions of the socket calls require the program to provide a tag
parameter to identify the particular operation. When AWAITIOX is called, it returns the
tag that was passed to it in the corresponding nowait socket call.
Table 3-4. SPXII—Nowait Client and Server Steps
Client Server
1. Optionally, set NonStop IPX/SPX
process name
(socket_set_nv_name).
1. Optionally, set NonStop IPX/SPX
process name
(socket_set_nv_name).
2. Create a socket (socket_nw,
followed by AWAITIOX).
2. Create a socket (socket_nw,
followed by AWAITIOX).
3. Prepare to access a SAP table by
issuing the SAP_OPEN function.
3. Bind the socket to an IPX address
(bind_nw, followed by AWAITIOX).
4. Issue a SAP query for the specified
service using the SAP_INFO_NW
function, followed by AWAITIOX.
4. Open the IPXPROTO process using
the SAP_OPEN_NW function, followed
by AWAITIOX.
5. Advertise service using the
SAP_START_NW function, followed
by AWAITIOX.
5. Connect the socket to the server
(connect_nw, followed by
AWAITIOX).
6. Listen for connections (listen).
7. Accept the connection:
a. Accept an incoming connection
(accept_nw, followed by
AWAITIOX).
b. Create a new socket
(socket_nw)with
(flags & 0xF1) nowait set.
c. Call AWAITIOX, followed by
SETMODE 30, followed by
AWAITIOX.
d. Accept the new connection on
the new socket (accept_nw2,
followed by AWAITIOX).
6. Start data transfer (send_nw and/or
recv_nw, followed by AWAITIOX,
usually in a loop).
8. Start data transfer on the new socket
(recv_nw and/or send_nw, followed
by AWAITIOX, usually in a loop).
7. Optionally, shut down the socket
(shutdown_nw, followed by
AWAITIOX).
9. Optionally, shut down one or both
sockets (shutdown_nw, followed by
AWAITIOX).
8. Close the socket (CLOSE or
FILE_CLOSE_).
10. Close the socket (CLOSE or
FILE_CLOSE_).