Socket.CancelConnectAsync Method (SocketAsyncEventArgs)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Cancels an asynchronous request for a remote host connection.

Namespace:   System.Net.Sockets
Assembly:  System (in System.dll)

static member CancelConnectAsync : 
        e:SocketAsyncEventArgs -> unit

Parameters

e
Type: System.Net.Sockets.SocketAsyncEventArgs

The System.Net.Sockets.SocketAsyncEventArgs object used to request the connection to the remote host by calling one of the ConnectAsync methods.

Exception Condition
ArgumentNullException

The e parameter cannot be null and the SocketAsyncEventArgs.RemoteEndPoint cannot be null.

SocketException

An error occurred when attempting to access the socket.

ObjectDisposedException

The Socket has been closed.

SecurityException

A caller higher in the call stack does not have permission for the requested operation.

The CancelConnectAsync method cancels an asynchronous request for a remote host connection.

Universal Windows Platform
Available since 10
.NET Framework
Available since 4.0
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.1
Return to top
Show: