CSocketWrench::GetOption Method  
 
INT GetOption(
  DWORD dwOption,  
  LPBOOL lpbEnabled  
);

The GetOption method is used to determine if a specific socket option has been enabled.

Parameters

dwOption
An unsigned integer used to specify one of the socket options. These options cannot be combined. The following values are recognized:
Constant Description
INET_OPTION_BROADCAST This option specifies that broadcasting should be enabled for datagrams. This option is invalid for stream sockets.
INET_OPTION_KEEPALIVE This option specifies that packets are to be sent to the remote system when no data is being exchanged to keep the connection active. This is only valid for stream sockets.
INET_OPTION_REUSEADDRESS This option specifies the local address can be reused. This option is commonly used by server applications.
INET_OPTION_NODELAY This option disables the Nagle algorithm, which buffers unacknowledged data and insures that a full-size packet can be sent to the remote host.
lpbEnabled
A pointer to a boolean flag. If the option is enabled, the flag is set to a non-zero value, otherwise it is set to a value of zero.

Return Value

If the method succeeds, the return value is zero. If the method fails, the return value is INET_ERROR. To get extended error information, call GetLastError.

Requirements

Minimum Desktop Platform: Windows 7 (Service Pack 1)
Minimum Server Platform: Windows Server 2008 R2 (Service Pack 1)
Header: Include cswsock10.h
Import Library: cswskv10.lib

See Also

Connect, SetOption