TCP/IP Programming Manual
Table 5 RAW—Waited 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.
Create a raw socket (socket) specifying the
protocol number.
2.Create a raw socket (socket) assigning
a protocol number. The default protocol
number is 255.
2.
Bind the socket to a local IP address (bind).3.Optionally, bind the socket to any local
IP address (bind).
3.
Optionally, specify the remote address (connect).4.Optionally, specify the remote address
(connect).
4.
If receiving messages, perform the following,
usually in a loop:
5.If sending messages, perform the
following, usually in a loop:
5.
a. Start data transfer (recvfrom if connect was
not called; recv if connect was called).
a. Build the header, as specified by
protocol, for type of message being sent.
b. Read and interpret message header and
interpret IP header.
b. Start data transfer (sendto if connect
was not called; send if connect was
called).
If sending messages, perform the following, usually
in a loop:
If receiving messages, perform the
following, usually in a loop:
a. Build the header, as specified by protocol, for
type of message being sent.
a. Start data transfer (recvfrom if
connect was not called; recv if
connect was called).
b. Start data transfer (sendto if connect was
not called; send if connect was called).
b. Read and interpret message header
and receive IP header preceding your
data.
Close the socket (CLOSE or FILE_CLOSE_).6.Close the socket (CLOSE or
FILE_CLOSE_).
6.
Table 6 shows the steps performed by a RAW client and a RAW server in nowait operations.
Table 6 RAW—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 raw socket (socket_nw)with (flags
& 0200) nowait set.
2.a. Create a raw socket (socket_nw)with
(flags & 0200) nowait set.
2.
b. Call AWAITIOX, followed by SETMODE 30,
followed by AWAITIOX, specifying the protocol
number.
b. Call AWAITIOX, followed by SETMODE
30, followed by AWAITIOX, specifying
the protocol number.
Bind the socket to a local IP address (bind_nw,
followed by AWAITIOX).
3.Optionally, bind the socket to a local IP
address (bind_nw, followed by
AWAITIOX).
3.
Optionally, specify the remote address
(connect_nw, followed by AWAITIOX).
4.Optionally, specify the remote address
(connect_nw, followed by AWAITIOX).
4.
If receiving messages, perform the following,
usually in a loop:
5.If sending messages, perform the
following, usually in a loop:
5.
42 Introduction to Programming to the Guardian Sockets Library