O'Reilly logo

Network Programming for Microsoft® Windows®, Second Edition by Jim Ohlund, Anthony Jones

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

Socket Options

The getsockopt function is most frequently used to get information about the given socket. The prototype for this function is

int getsockopt (
    SOCKET s, 
    int level, 
    int optname, 
    char FAR* optval, 
    int FAR* optlen
);

The first parameter, s, is the socket on which you want to perform the specified option. This must be a valid socket for the given protocol you are using. A number of options are specific to a particular protocol and socket type, while others pertain to all types of sockets. This ties in with the second parameter, level. An option of level SOL_SOCKET means it is a generic option that isn’t necessarily specific to a given protocol. We say “necessarily” because not all protocols implement each ...

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