共用方式為


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

傳回

適用於