Jaa


StreamSocketInformation.RemoteHostName Property

Definition

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

public:
 property HostName ^ RemoteHostName { HostName ^ get(); };
HostName RemoteHostName();
public HostName RemoteHostName { get; }
var hostName = streamSocketInformation.remoteHostName;
Public ReadOnly Property RemoteHostName As HostName

Property Value

The hostname or IP address of the remote network destination.

Windows requirements

App capabilities
ID_CAP_NETWORKING [Windows Phone]

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.

Applies to

See also