IPX/SPX Programming Manual
Programming Using the Socket Interface
HP NonStop IPX/SPX Programming Manual—528022-001
3-5
Basic Steps for Programs
Basic Steps for Programs
This subsection summarizes the basic steps performed by client and server programs
for the IPX and SPXII protocols. Important considerations for each type of program are
provided later in this subsection.
Client Program
The basic steps performed by a client program are:
1. Designate the NonStop IPX/SPX process name (optional).
2. Create a socket.
3. Execute a SAP_OPEN call to the specified IPXPROTO process, to allow SAP table
access.
4. Query for service information using the SAP_INFO function.
5. Connect the socket (required for SPXII; not needed for IPX).
6. Start data transfer.
7. Shut down the socket (optional for SPXII; IPX sockets cannot be shut down using
shutdown).
8. Close the socket.
Designating the NonStop IPX/SPX Process Name
To create a socket, the socket interface library opens a file to communicate with the
NonStop IPX/SPX process. Therefore, the socket library must know the name of this
IPXPROTO process before any socket can be created. Programs can specify this
process explicitly by calling the function socket_set_nv_name.
If a program has not called socket_set_nv_name before creating a socket, the
function that creates a socket makes default assumptions about the process name.
The function uses the value of the NETWARE^PROCESS^NAME set by a DEFINE
command (if it exists).
Creating a Socket
A program calls the socket function to create a socket. The program passes this
socket number to subsequent calls for operations on that socket.
Querying for Service Information
Use the SAP_INFO function to query the NetWare server for the source and
destination addresses, port numbers, and type information for a specified service.