IPX/SPX Programming Manual

Programming Using the Socket Interface
HP NonStop IPX/SPX Programming Manual528022-001
3-9
Programmatic Interface to IPX and SPXII
Programmatic Interface to IPX and SPXII
The format of data transferred is known to the client and server only, and is not
interpreted by the subsystems or protocols. Because application programs run at the
IPX and SPXII levels, they can pass appropriate header parameters to the socket
function calls and send or receive data without assembling and disassembling the
headers.
SPXII Client and Server Programs
Table 3-3 shows the steps performed by an SPXII client and an SPXII server in waited
operations. The calls used to perform each step are listed in parentheses. Guardian
procedure calls are spelled out in uppercase letters.
Table 3-4 shows the steps performed by an SPXII client and an SPXII server in nowait
operations. The calls used to perform each step are given in parentheses. Note the
use of nowait versions of most of the socket calls, followed by calls to the Guardian
AWAITIOX procedure for completion of the call.
Table 3-3. SPXII—Waited 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). 2. Create a socket (socket).
3. Prepare to access a SAP table by
issuing the SAP_OPEN function.
3. Bind the socket to an IPX address
(bind).
4. Issue a SAP query for the specified
service using the SAP_INFO
function.
4. Open the IPXPROTO process using
the SAP_OPEN function.
5. Listen for connections (listen).
5. Connect the socket to the server
(connect).
6. Advertise service using the
SAP_START function.
7. Accept an incoming connection on a
new socket (accept).
6. Start data transfer (send and/or
recv, usually in a loop).
8. Start data transfer on the new socket
(recv and/or send, usually in a
loop).
7. Optionally, shut down the socket
(shutdown).
9. Optionally, shut down one or both
sockets (shutdown).
8. Close the socket (CLOSE or
FILE_CLOSE_).
10. Close the socket (CLOSE or
FILE_CLOSE_).