Share via


StreamSocketInformation.RemoteServiceName Property

Definition

Get the service name or TCP port number of the remote network destination associated with a StreamSocket object.

public:
 property Platform::String ^ RemoteServiceName { Platform::String ^ get(); };
winrt::hstring RemoteServiceName();
public string RemoteServiceName { get; }
var string = streamSocketInformation.remoteServiceName;
Public ReadOnly Property RemoteServiceName As String

Property Value

String

Platform::String

winrt::hstring

The service name or TCP port number of the remote network destination.

Windows requirements

App capabilities
ID_CAP_NETWORKING [Windows Phone]

Remarks

The RemoteServiceName property represents the remote service name or TCP port number for the remote network destination associated with a StreamSocket object. The remote service name or TCP port that a StreamSocket object connects to is passed in the remoteServiceName parameter to the ConnectAsync method on the StreamSocket.

The RemoteServiceName property can be one of the following:

  • A numeric literal for a TCP port number (80 for the TCP port typically used for the HTTP protocol, for example).
  • A string alias for a port number ("http", for example) that matches a string in the following file on the local computer: %WINDIR%\system32\drivers\etc\services
  • A service name that can be resolved by a namespace provider using a SRV record. The RemoteHostName 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