Socket.CancelConnectAsync(SocketAsyncEventArgs) Socket.CancelConnectAsync(SocketAsyncEventArgs) Socket.CancelConnectAsync(SocketAsyncEventArgs) Socket.CancelConnectAsync(SocketAsyncEventArgs) Method

定义

取消一个对远程主机连接的异步请求。Cancels an asynchronous request for a remote host connection.

public:
 static void CancelConnectAsync(System::Net::Sockets::SocketAsyncEventArgs ^ e);
public static void CancelConnectAsync (System.Net.Sockets.SocketAsyncEventArgs e);
static member CancelConnectAsync : System.Net.Sockets.SocketAsyncEventArgs -> unit
Public Shared Sub CancelConnectAsync (e As SocketAsyncEventArgs)

参数

e
SocketAsyncEventArgs SocketAsyncEventArgs SocketAsyncEventArgs SocketAsyncEventArgs

SocketAsyncEventArgs 对象,该对象用于通过调用 ConnectAsync(SocketType, ProtocolType, SocketAsyncEventArgs) 方法之一,请求与远程主机的连接。The SocketAsyncEventArgs object used to request the connection to the remote host by calling one of the ConnectAsync(SocketType, ProtocolType, SocketAsyncEventArgs) methods.

异常

e 参数不能为 null,并且 RemoteEndPoint 不能为空。The e parameter cannot be null and the RemoteEndPoint cannot be null.

尝试访问套接字时出错。An error occurred when attempting to access the socket.

调用堆栈中的较高调用方无权执行所请求的操作。A caller higher in the call stack does not have permission for the requested operation.

注解

CancelConnectAsync方法取消对远程主机连接的异步请求。The CancelConnectAsync method cancels an asynchronous request for a remote host connection.

适用于