Communications Technical Reference, Volume 2 getsockopt Subroutine Purpose Gets options on sockets. The getsockopt subroutine allows an application program to query socket options. The calling program specifies the name of the socket, the name of the option, and a place to store the requested information. The operating system gets the socket option information from its internal data structures and passes the requested information back to the calling program.
Options can exist at multiple protocol levels.
They are always present at the uppermost socket level. When retrieving socket options, specify the level where the option resides and the name of the option. Parameters Socket Specifies the unique socket name. Level Specifies the protocol level where the option resides. Other levels Supplies the appropriate protocol number for the protocol controlling the option.