Export (0) Print
Expand All
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

StreamSocketInformation.LocalAddress | localAddress property

Applies to Windows and Windows Phone

Gets the local IP address associated with a StreamSocket object.

Syntax


var localAddress = streamSocketInformation.localAddress;

Property value

Type: HostName

The local IP address or hostname.

Remarks

The LocalAddress property represents the local IP address the StreamSocket object is bound to after a connection is established.

An app can set the local hostname or IP address to use by calling the ConnectAsync(EndpointPair) or ConnectAsync(EndpointPair, SocketProtectionLevel) method on the StreamSocket. The connect operation will bind the socket to the specific local IP address and local UDP port number. After the bind or connect operation completes, the LocalAddress property contains the IP address and the LocalPort property contains the local TCP port number that the local hostname and service name resolved to.

If the local hostname or IP address passed to the ConnectAsync(EndpointPair) or ConnectAsync(EndpointPair, SocketProtectionLevel) method is null or the ConnectAsync(HostName, String) or ConnectAsync(HostName, String, SocketProtectionLevel) method is called, the system will determine the local IP address to bind to the StreamSocket object.

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

Other resources
How to use advanced socket controls (HTML)
How to use advanced socket controls (XAML)
Reference
ConnectAsync
HostName
LocalPort
StreamSocket
StreamSocketInformation

 

 

Show:
© 2014 Microsoft