- reuseSocket
- true if this socket can be reused after the connection is closed; otherwise, false.
- callback
- The AsyncCallback delegate.
- state
- An object that contains state information for this request.
An IAsyncResult object that references the asynchronous operation.
If you are using a connection-oriented protocol, you can call the Socket.BeginDisconnect(bool, AsyncCallback, object) method to request a disconnect from a remote endpoint. If reuseSocket is true, you can reuse the socket.
The Socket.BeginDisconnect(bool, AsyncCallback, object) method uses a separate thread to invoke the specified callback method. The Socket.EndDisconnect(IAsyncResult) method blocks until the pending disconnect is complete. For additional information on writing callback methods, see [<topic://cpconcallbacksample>].
If you receive a System.Net.Sockets.SocketException exception, use the SocketException.ErrorCode property to obtain the specific error code. After you have obtained this code, refer to the Windows Sockets version 2 API error code documentation in the MSDN library for a detailed description of the error.
This member outputs trace information when you enable network tracing in your application. For more information, see [<topic://conUsingNetworkTracing>].