We still have the situation where we cannot restart our routing server within a few minutes of our last use of the server. The Set Socket Options API, SETSOCKOPT, can address this.
The parameter descriptions for SETSOCKOPT are shown in Figure 15.39. The SETSOCKOPT API takes five parameters. The first one, Socket_descriptor, is the socket descriptor you want to modify.
int setsockopt (int socket_descriptor, int level, int option_name, char *option_value, int option_length)
The second parameter, Level, specifies whether you want to modify the socket itself or the underlying protocol of the socket. Enabling the reuse of a socket port is done via an attribute of the socket. We will use the ...