HP Rp7410 BSD Sockets Interface Programmer's Guide - Page 62
Getting and Setting Socket Options
View all HP Rp7410 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 62 highlights
Advanced Topics for Stream Sockets Socket Options • SO_SNDTIMEO • SO_RCVTIMEO • SO_BROADCAST • SO_REUSEPORT In addition, the SO_DEBUG option is supported for compatibility only; it has no functionality. Options for protocol levels are described in the individual protocol manual pages, such as tcp(7p), udp(7p), and ip(7p). The next section describes how to get the current value of a socket option and to set socket options, followed by a description of each available option. Refer to chapter 6 for a description of the SO_BROADCAST option. Getting and Setting Socket Options The socket options are defined in the sys/socket.h file. You can get the current status of an option with the getsockopt call, and you can set the value of an option with the setsockopt call. getsockopt and its parameters are described in the following table: Include files: System call: #include #include getsockopt(s, level, optname, optval, optlen) int s, level, optname; char *optval; int *optlen; 62 Chapter 3