O'Reilly logo

APIs at Work, Second Edition by Ron Hawkins, Doug Pence, Bruce Vining

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the SETSOCKOPT API

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.

Figure 15.39. The SETSOCKOPT API.
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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required