Share via


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;
/// [Windows.Foundation.Metadata.RemoteAsync]
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 Uri

An absolute Uri for the server to connect to.

Returns

An asynchronous connect operation on a MessageWebSocket object.

Implements

M:Windows.Networking.Sockets.IWebSocket.ConnectAsync(Windows.Foundation.Uri) M: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