HP Rp3440-4 - 9000 - 0 MB RAM Programmer's Manual page 63

Bsd sockets interface programmer’s guide
Hide thumbs Also See for Rp3440-4 - 9000 - 0 MB RAM:
Table of Contents

Advertisement

Parameter
Contents
s
socket
descriptor
level
protocol
level
optname
name of
option
optval
pointer to
current
value of
option
optlen
pointer to
length of
optval
Function result: 0 if the option is set. If getsockopt fails for any reason,
the function returns -1, and the option is not returned.
An error code is stored in errno.
Example:
len = sizeof (optval))
getsockopt(s, SOL_SOCKET, SO_REUSEADDR, &optval, &len;)
optval may never be zero. It must always point to data sent with the
socket option and must always be at least the size of an integer.
The following socket options set socket parameter values. optval is an
integer containing the new value:
• SO_SNDBUF
• SO_RCVBUF
• SO_SNDLOWAT
• SO_RCVLOWAT
• SO_SNDTIMEO
Chapter 3
Advanced Topics for Stream Sockets
INPUT Value
socket descriptor
for which option
values are to be
returned
SOL_SOCKET
supported option
name
pointer to buffer
where option's
current value is to
be returned
pointer to
maximum number
of bytes to be
returned by optval
Socket Options
OUTPUT
Value
unchanged
unchanged
unchanged
pointer to buffer
that contains
current option
value
pointer to
actual size of
optval returned
63

Advertisement

Table of Contents
loading

Table of Contents