StreamSocketInformation.LocalAddress | localAddress property
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 |
|
|
Metadata |
|
|
DLL |
|
|
Capabilities |
|
See also
Build date: 2/25/2013
