WebSocketClient.ConnectAsync(Uri, CancellationToken) 方法

定义

与终结点建立 WebSocket 连接。

public:
 System::Threading::Tasks::Task<System::Net::WebSockets::WebSocket ^> ^ ConnectAsync(Uri ^ uri, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<System.Net.WebSockets.WebSocket> ConnectAsync (Uri uri, System.Threading.CancellationToken cancellationToken);
member this.ConnectAsync : Uri * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Net.WebSockets.WebSocket>
Public Function ConnectAsync (uri As Uri, cancellationToken As CancellationToken) As Task(Of WebSocket)

参数

uri
Uri

终结点的 Uri

cancellationToken
CancellationToken

CancellationToken用于终止连接的 。

返回

适用于