TCP/IP Programming Manual

The following considerations apply to this parameter:
The function socket_nw() internally maps the old FLAGS parameter to the corresponding
parameters for the FILE_OPEN_().
The flags parameter is not used for the socket function (waited operations). For the
socket_nw function, flags.< bit 8> = 1 indicates a nowaited file open and flags.< bits
12:15> indicates the maximum number of outstanding nowaited I/Os allowed (nowait
depth).
sync
input value; not supported for Guardian sockets. It must always be set to zero.
Errors
If an error occurs, the return value is set to -1 and the external variable errno is set to one of the
following values:
The address family specified in address_family is not supported.EAFNOSUPPORT
The socket type specified in socket_type is not supported.ESOCKTNOSUPPORT
The protocol specified was not in the range 0 to 255, or was the value reserved for TCP,
UDP, or ICMP.
EPROTONOSUPPORT
Usage Guidelines
The socket or socket_nw function opens the NonStop TCP/IP or TCP6SAM process by
name; therefore, the function must know the name of this process. If your program calls the
socket_set_inet_name function before calling the socket or socket_nw function, the
socket library opens the process you specify.
If your program does not call socket_set_inet_name, the socket library opens the process
with the name defined for =TCPIP^PROCESS^NAME. If a defined name does not exist, the
socket library uses the process name $ZTC0. For more information on
=TCPIP^PROCESS^NAME, see Using the DEFINE Command (page 29).
When a nowaited socket open (flags.< bit8> = 1) is specified:
The socket_nw() must be completed by calling AWAITIOX().
Tag returned is -30D.
SETMODE 30 must be called to allow I/O operations to complete in any order.
To allow nowaited I/O operations, a socket must have nowait depth > 0 (flags.< bit 12:15>).
The nowait versions (_nw) of the socket routines must be used for subsequent operations on
the socket.
For nowait operations on a socket, set a nowait depth >= 2 to allow pending simultaneous
reads and writes.
See Nowait Call Errors (page 86) for information on error checking.
Example
See accept_nw (page 91) for an example that uses a call to socket_nw.
socket_backup
The socket_backup function returns data to the backup process of a NonStop process pair,
after the primary process has checkpointed the data using the socket_get_open_info function.
This function is designed to allow applications to establish a backup open to a NonStop TCP/IP,
TCPSAM, or TCP6SAM process.
socket_backup 193