Starts an asynchronous operation to connect to a remote network destination on a MessageWebSocket object.
public:
IAsyncAction^ ConnectAsync(
Uri^ uri
)
uri
Type: Uri
An absolute Uri for the server to connect to.
Type: IAsyncAction
Returns an IAsyncAction object that represents the state of the asynchronous operation. Completion of the asynchronous operation is signaled by using a handler that is passed to the IAsyncAction.Completed property.
The ConnectAsync method initiates the WebSocket handshake with a remote network destination, and then negotiates the subprotocol.
For WebSocket connections over TCP, use the ws:// scheme in the uri. For secure WebSocket connections over TLS/SSL, use the wss:// scheme.
Namespace: Windows.Networking.Sockets
Metadata: windows.winmd