MessageWebSocket.ConnectAsync Method

Starts an asynchronous operation to connect to a remote network destination on a MessageWebSocket object.

Syntax

public:
IAsyncAction^ ConnectAsync(
         Uri^ uri
)  

Parameters

uri
Type: Uri 

  An absolute Uri for the server to connect to.

Return value

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.

Remarks

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.

Requirements

Namespace: Windows.Networking.Sockets

Metadata: windows.winmd

See also

Reference

MessageWebSocket Class

MessageWebSocket Members

Windows.Networking.Sockets Namespace