Skip to main content
StreamSocket.ConnectAsync | connectAsync methods

Applies to Windows and Windows Phone

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

Overload list

MethodDescription
ConnectAsync(EndpointPair) Starts an asynchronous operation on a StreamSocket object to connect to a remote network destination specified as an EndpointPair object.
ConnectAsync(HostName, String) Starts an asynchronous operation on a StreamSocket object to connect to a remote network destination specified by a remote hostname and a remote service name.
ConnectAsync(EndpointPair, SocketProtectionLevel) Starts an asynchronous operation on a StreamSocket object to connect to a remote network destination specified as an EndpointPair object and a SocketProtectionLevel enumeration. This method is not callable from JavaScript.
ConnectAsync(HostName, String, SocketProtectionLevel) Starts an asynchronous operation on a StreamSocket object to connect to a remote destination specified by a remote hostname, a remote service name, and a SocketProtectionLevel.
ConnectAsync(HostName, String, SocketProtectionLevel, NetworkAdapter) Starts an asynchronous operation on a StreamSocket object on a specified local network adapter to connect to a remote destination specified by a remote hostname, a remote service name, and a SocketProtectionLevel.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8

Namespace

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

Metadata

Windows.winmd

DLL

Windows.Networking.dll

Capabilities

ID_CAP_NETWORKING [Windows Phone]

See also

StreamSocket