Sockets Programming Interfaces
3-21
Sockets and Stream IO API
Options that are not Berkeley standard:
SO_IFDEVICE
Specifies a uint index (1 to n) of the designated in-
terface for sending and receiving IP broadcast pack-
ets. When set, this interface is selected on a IP
broadcast send operation if the socket’s local
(bound) IP address is NULL (INADDR_ANY). Also,
when set, the socket will only accept incoming
broadcast packets if they have been received on
this interface.
SO_BLOCKING
Specifies a int flag (1 or 0) indicating if the socking
is in blocking or non-blocking mode. Sockets default
to blocking mode when created, but can be set to
non-blocking by using setsockopt(). This option pro-
vides the same functionality as calling the Unix
function Fcntl() with the O_NONBLOCK flag.
The following options are recognized at the IPPROTO_IP level:
IP_OPTIONS
Specifies the IP options to be including in any out-
going IP packet sent via this socket (maximum
length is 20 bytes)
IP_HDRINCL
Indicates to IP that the socket application is supply-
ing the IP header as well as the rest of the packet
payload. This is for use with RAW sockets only.
IP_TOS
Specifies the TOS value to place in the IP header.
IP_TTL
Specifies the TTL value to plate in the IP header.
The following options are recognized at the IPPROTO_TCP level:
TCP_NODELAY
Don’t delay sends in an attempt to combine future
data packets.
TCP_MAXSEG
Set the maximum TCP segment size.
TCP_NOPUSH
Don’t send just to finish a data block.
TCP_NOOPT
Don’t use TCP options.