CSocketWrench::Shutdown Method  
 
INT Shutdown(
  DWORD dwOption  
);

The Shutdown method is used to disable reception or transmission of data, or both.

Parameters

dwOption
An unsigned integer used to specify one of the shutdown options. These options cannot be combined. The following values are recognized:
Value Constant Description
0 INET_SHUTDOWN_READ Disable reception of data.
1 INET_SHUTDOWN_WRITE Disable transmission of data.
2 INET_SHUTDOWN_BOTH Disable both reception and transmission of data.

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.

Remarks

This method is rarely needed. It is provided as an interface to the Windows Sockets shutdown method.

In some asynchronous applications, it may be desirable for a client to inform the server that no further communication is wanted, while allowing the client to read any residual data that may reside in internal buffers on the client side. Shutdown accomplishes this because the socket handle is still valid after it has been called, although some or all communication with the remote host has ceased.

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

Abort, Connect, Disconnect