StreamWebSocket.ConnectAsync(Uri) StreamWebSocket.ConnectAsync(Uri) StreamWebSocket.ConnectAsync(Uri) StreamWebSocket.ConnectAsync(Uri) StreamWebSocket.ConnectAsync(Uri) Method

Definition

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

public : IAsyncAction ConnectAsync(Uri uri)
IAsyncAction ConnectAsync(Uri uri) const;
public IAsyncAction ConnectAsync(Uri uri)
Public Function ConnectAsync(uri As Uri) As IAsyncAction
Windows.Networking.Sockets.StreamWebSocket.connectAsync(uri).done( /* Your success and error handlers */ );

Parameters

uri
Uri Uri Uri

An absolute Uri for the server to connect to.

Returns

An asynchronous connect operation on a StreamWebSocket object.

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.

See also

  • Uri Uri Uri