IPX/SPX Programming Manual

HP NonStop IPX/SPX Programming Manual528022-001
3-1
3
Programming Using the Socket
Interface
This section describes the structure of client and server programs that use the socket
library routines, and presents some general programming considerations. It also
provides the information you need in order to port existing programs from another
implementation of IPX/SPX, or to create application programs.
For detailed descriptions of all the routines in the socket library, refer to Section 5,
Library Routines. For descriptions of the NonStop Kernel operating system calls you
need in your programs, including calls to the file-system procedures AWAITIOX and
FILE_CLOSE_, refer to the Guardian Procedure Calls Reference Manual. For general
information on programming for the NonStop Kernel, including discussions of
interprocess communication and nowait I/O, see the HP NonStop Kernel
Programmers Guide.
Porting Considerations
The socket library routines are based on the 4.3 BSD implementation of the UNIX
operating system. However, there are some differences, mostly resulting from
differences between the NonStop Kernel operating system and the UNIX environment.
Therefore, some parts of your programs will need to change if you are porting them
from the 4.3 BSD UNIX operating system or from some other NetWare implementation.
Nowait I/O
Nowait I/O in the NonStop Kernel operating system environment is similar to
nonblocking I/O in UNIX, but there are important differences. First, nowait I/O can be
performed only over a socket that was created for nowait I/O (with a call to the
socket_nw function). After a socket is created, it cannot be switched from one mode
to the other.
The following nonstandard socket calls are available for nowait I/O:
accept_nw getsockname_nw sendto_nw
accept_nw2 getsockopt_nw setsockopt_nw
bind_nw recv_nw shutdown_nw
connect_nw recvfrom_nw socket_nw
getpeername_nw send_nw2 socket_ioctl_nw