![]()
Returns System.Threading.Tasks.Task.
The task object representing the asynchronous operation.
The ClientWebSocket.ConnectAsync(Uri, System.Threading.CancellationToken) method initiates the WebSocket handshake with a remote network destination, and then negotiates the sub-protocol.
For plain WebSocket connections, use the ws:// scheme in the uri. For secure WebSocket connections over TLS/SSL, use the wss:// scheme.
This operation will not block. The returned System.Threading.Tasks.Task object will complete after the connect request on the System.Net.WebSockets.ClientWebSocket instance has completed.