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用來終止連接的。

傳回

Task<WebSocket>

適用於