INT WINAPI InetShutdown( |
|
SOCKET hSocket, |
|
|
DWORD dwOption |
|
); |
The InetShutdown function is used to disable reception or
transmission of data, or both.
Parameters
- hSocket
- The socket handle.
- dwOption
- An unsigned integer used to specify one of the shutdown
options. These options cannot be combined. The following values are
recognized:
Value |
Description |
INET_SHUTDOWN_READ |
Disable reception of data. |
INET_SHUTDOWN_WRITE |
Disable transmission of data. |
INET_SHUTDOWN_BOTH |
Disable both reception and transmission of data. |
Return Value
If the function succeeds, the return value is zero. If the
function fails, the return value is INET_ERROR. To get extended error
information, call InetGetLastError.
Remarks
This function is rarely needed. It is provided as an interface to
the Windows Sockets shutdown function.
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. InetShutdown
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 File: cswsock11.h
Import Library: cswskv11.lib
See Also
InetDisconnect
|