TCP/IP Programming Manual
See Usage/Bind Considerations (page 87) for information about the HP implementation that
handles the binding of UDP sockets. The implementation ensures that the correct process is notified
when a broadcast message arrives.
Table 4 shows the steps performed by a UDP client and a UDP server in nowait operations.
Table 4 UDP—Nowait Client and Server Steps
ServerClient
Optionally, set NonStop TCP/IP, TCPSAM, or
TCP6SAM process name
(socket_set_inet_name).
1.Optionally, set NonStop TCP/IP,
TCPSAM, or TCP6SAM process name
(socket_set_inet_name).
1.
a. Create a new socket (socket_nw) with (flags
& 0200) nowait set.b. Call AWAITIOX, followed
by SETMODE 30, followed by AWAITIOX).
2.a. Create a new socket (socket_nw)with
(flags & 0200) nowait set.b. Call
AWAITIOX, followed by SETMODE 30,
followed by AWAITIOX).
2.
Bind the socket to a well-known port (bind_nw,
followed by AWAITIOX).
3.Optionally, bind the socket to any port
(bind_nw, followed by AWAITIOX).
3.
Start data transfer on the new socket
(t_recvfrom_nw and/or t_sendto_nw,
followed by AWAITIOX, usually in a loop).
4.Start data transfer (t_sendto_nw and/or
t_recvfrom_nw, followed by
AWAITIOX, usually in a loop).
4.
OROR
Specify the remote address for the socket
(connect_nw, followed by AWAITIOX). Then,
Specify the remote address for the socket
(connect_nw, followed by AWAITIOX).
start data transfer on the socket (recv_nw and/orThen, start data transfer (send_nw and/or
send_nw, followed by AWAITIOX, usually in a
loop).
recv_nw, followed by AWAITIOX,
usually in a loop).
Close the socket (CLOSE or FILE_CLOSE_).5.Close the socket (CLOSE or
FILE_CLOSE_).
5.
Programmatic Interface to Raw Sockets
A raw socket allows direct access to a lower-level protocol—in this case, IP. Access to link-level
(Layer 2) protocols is not supported for NonStop TCP/IP, Parallel Library TCP/IP, or NonStop
TCP/IPv6. Raw sockets are intended for processes that require the use of some protocol feature
not directly accessible through the normal interface, or are intended for the development of new
protocols.
Only limited support exists for programming to the raw sockets interface for NonStop TCP/IPv6
and Parallel Library TCP/IP. An application can transmit from any processor using the raw-socket
interface but can only receive transmissions in the processor that contains the master TCP6MON
or master TCPMON.
Programming at the IP level and using raw sockets requires more work on the part of application
clients and servers than programming at the TCP level. First, the application must provide underlying
support for whatever transport protocol is used above IP. (For a list of possible protocols, refer to
RFC 1010, “Assigned Numbers.”) Then, when performing the basic steps outlined at the beginning
of this section, clients and servers must build the transport-level message headers before sending
messages, and interpret transport-level message headers and IP headers (including checksums)
after receiving the messages. The format for these headers depends on the protocol; for details
about the protocol requirements, refer to the appropriate RFC for that protocol.
If your application program refers to a transport protocol by name, the protocol number and name
must be included in the file $SYSTEM.ZTCPIP.PROTOCOL, as described in the TCP/IPv6
Configuration and Management Manual.
Table 5 shows the steps performed by a RAW client and a RAW server in waited operations.
Programmatic Interface to Raw Sockets 41