SocketTools .NET Edition

SocketWrench.Shutdown Method (ShutdownOptions)

Disable sending or receiving data on the socket.

[Visual Basic]
Overloads Public Function Shutdown( _
   ByVal options As ShutdownOptions _
) As Boolean
[C#]
public bool Shutdown(
   ShutdownOptions options
);

Parameters

options
One of the ShutdownOptions enumeration values which specifies the operation that will no longer be allowed.

Return Value

A boolean value which specifies if the operation completed successfully. A return value of false indicates an error has occurred. To get extended error information, check the value of the LastError property.

Remarks

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.

Note that most applications do not typically need to use this method. To close a socket connection gracefully, you should use the Disconnect method.

See Also