This topic has not yet been rated - Rate this topic

StreamSocketInformation.RemoteHostName | remoteHostName property

Applies to Windows and Windows Phone

Get the hostname or IP address of the remote network destination associated with a StreamSocket object.

Syntax


var remoteHostName = streamSocketInformation.remoteHostName;

Property value

Type: HostName

The hostname or IP address of the remote network destination.

Remarks

The RemoteHostName property represents the remote hostname or IP address for the remote network destination associated with a StreamSocket object. The remote hostname or IP address that a StreamSocket object connects to is passed in the remoteHostName parameter to the ConnectAsync method on the StreamSocket.

The RemoteHostName property can be one of the following:

  • The name of the local host that can be resolved by the Domain Name System (DNS) or by another namespace provider.
  • The name of the local host that matches a string in the following file on the local computer: %WINDIR%\\system32\drivers\etc\hosts.
  • A string that contains an IPv4 or an IPv6 network address of the local host. An IPv4 address string is in dotted-decimal notation ("192.168.1.111", for example). An IPv6 address is in hexadecimal notation ("21DA:00D3:0010:2F3B:02AA:00FF:FE28:9C5A", for example).

When this property is the "localhost" string, this represents all loopback addresses on the local computer.

The RemoteServiceName property represents the remote service name or TCP port number for the remote network destination associated with a StreamSocket object.

After a connection is established, the RemoteAddress property contains the IP address and the RemotePort property contains the TCP port number of the remote endpoint for the socket connection.

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

ConnectAsync
HostName
RemoteAddress
RemotePort
RemoteServiceName
StreamSocket
StreamSocketInformation

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.