Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Socket::CancelConnectAsync Method (SocketAsyncEventArgs^)

 

Cancels an asynchronous request for a remote host connection.

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

public:
static void CancelConnectAsync(
	SocketAsyncEventArgs^ e
)

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:
© 2017 Microsoft