System.Net.Sockets.Socket.EndDisconnect Method

Ends a pending asynchronous disconnect request.

Syntax

public void EndDisconnect (IAsyncResult asyncResult)

Parameters

asyncResult
An IAsyncResult object that stores state information and any user-defined data for this asynchronous operation.

Remarks

Socket.EndDisconnect(IAsyncResult) completes a call to Socket.BeginDisconnect(bool, AsyncCallback, object). The Socket.EndDisconnect(IAsyncResult) method blocks until the disconnect completes. For information about asynchronous operations, see the Asynchronous Programming Overview topic in the MSDN library.

Note:

If you receive a System.Net.Sockets.SocketException, 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.

Note:

This member outputs trace information when you enable network tracing in your application. For more information, see [<topic://conUsingNetworkTracing>].

Requirements

Namespace: System.Net.Sockets
Assembly: System (in System.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0