StreamWebSocket.ConnectAsync | connectAsync method

Applies to Windows and Windows Phone

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

Syntax


streamWebSocket.connectAsync(uri).done( /* Your success and error handlers */ );

Parameters

uri

Type: Windows.Foundation.Uri [JavaScript] | System.Uri [.NET] | Windows::Foundation::Uri [C++]

An absolute Uri for the server to connect to.

Return value

Type: IAsyncAction

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.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.Networking.Sockets
Windows::Networking::Sockets [C++]

Metadata

Windows.winmd

DLL

Windows.Networking.dll

See also

StreamWebSocket
Uri

 

 

Show:
© 2014 Microsoft