TCP/IP Programming Manual

Support routines assist in name translation, enabling you to use easy-to-understand symbolic names
for objects, hosts, and services. However, they are not essential for data transmission using the
socket library, and only two of them—gethostname and gethostid—communicate with the
TCP/IP process.
NOTE: Certain socket options are supported differently in CIP. See the Cluster I/O Protocols
(CIP) Configuration and Management Manual for details.
Table 12 lists and briefly describes each socket routine and provides the page number where the
routine is described.
Table 12 Socket Routines
FunctionName and Description Page
Listens for connections on an existing socket, creates a new socket
for data transfer, and accepts a connection on the new socket
(waited)
accept (page 89)
Listens for connections on an existing socket (nowait)accept_nw (page 91)
Allows you to change queue length when listening for connections
on an existing socket (nowait)
accept_nw1 (page 94)
Creates a new socket for data transfer and accepts a connection on
the new socket (nowait)
accept_nw2 (page 95)
Binds a socket to an address and port number (waited or nowait)bind, bind_nw (page 98)
Connects a socket to a remote socket (waited or nowait)connect, connect_nw (page 102)
Gets the address and port number to which a socket is bound (waited
or nowait)
getsockname, getsockname_nw (page 126)
Gets socket options (waited or nowait)getsockopt, getsockopt_nw (page 128)
Sets the queue length (provided for compatibility only; queue length
always set to 5)
if_freenameindex (page 130)
Receives data on a socket (waited or nowait)recv, recv_nw (page 153)
Receives data on a socket (waited or nowait) in 64–bit application.recv64_, recv_nw64_ (page 155)
Receives data on an unconnected UDP or raw socket (waited and
nowait)
recvfrom (page 158)
Receives data on an unconnected UDP or raw socket (waited and
nowait) in 64–bit application.
recvfrom64_
Receives data on an unconnected UDP socket or raw socket created
for nowait operations
recvfrom_nw (page 161)
Receives data on an unconnected UDP socket or raw socket created
for nowait operations in 64–bit application.
recvfrom_nw64_ (page 164)
Sends data on a socket (waited)send (page 166)
Sends data on a socket (waited) in 64–bit application.send64_ (page 168)
Sends data on a socket (nowait)send_nw (page 169)
Sends data on a socket (nowait) in 64–bit application.send_nw64_” (page 171)
Sends data on a socket without byte-count header (nowait)send_nw2 (page 173)
Sends data on a socket without byte-count header (nowait) in 64–bit
application.
send_nw2_64_ (page 175)
Sends data on an unconnected UDP or raw socket (waited)sendto (page 177)
Sends data on an unconnected UDP or raw socket (waited) in 64–bit
application.
sendto64_ (page 179)
82 Library Routines