MessageWebSocket.ConnectAsync(Uri) Method

Definition

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

public:
 virtual IAsyncAction ^ ConnectAsync(Uri ^ uri) = ConnectAsync;
IAsyncAction ConnectAsync(Uri const & uri);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncAction ConnectAsync(System.Uri uri);
function connectAsync(uri)
Public Function ConnectAsync (uri As Uri) As IAsyncAction

Parameters

uri
Uri

An absolute Uri for the server to connect to.

Returns

Implements

Windows.Networking.Sockets.IWebSocket.ConnectAsync(System.Uri)
Attributes

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.

Applies to

See also