HP Rp7410 BSD Sockets Interface Programmer's Guide - Page 65
So_reuseaddr
View all HP Rp7410 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 65 highlights
Advanced Topics for Stream Sockets Socket Options Parameter Description of Contents optname optval name of option pointer to option input value optlen length of optval INPUT Value supported option name Must be at least size of (int). Holds either value to be set or boolean flag size of optval Function result: 0 if setsockopt is successful, -1 if failure occurs. Example: See the description of the SO_REUSEADDR option for an example. Refer to the setsockopt(2) man page for more information on setsockopt. SO_REUSEADDR This option is AF_INET socket-specific. SO_REUSEADDR enables you to restart a daemon which was killed or terminated. This option modifies the rules used by bind to validate local addresses, but it does not violate the uniqueness requirements of an association. SO_REUSEADDR modifies the bind rules only when a wildcard Internet Protocol (IP) address is used in combination with a particular protocol port. The host still checks at connection time to be sure any other sockets with the same local address and local port do not have the same remote address and remote port. Connect fails if the uniqueness requirement is violated. Example of the SO_REUSEADDR Option A network daemon server is listening on a specific port: port 2000. If you executed netstat an, part of the output would resemble: Active connections (including servers) Proto Recv-Q Send-Q Local Address Foreign Address (state) tcp 0 0 *.2000 *.* LISTEN Chapter 3 65