StreamSocketInformation.RemoteServiceName | remoteServiceName property

Applies to Windows and Windows Phone

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

Syntax


public string RemoteServiceName { get; }

Property value

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

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

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.

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
RemoteAddress
RemoteHostName
RemotePort
StreamSocket
StreamSocketInformation

 

 

Show:
© 2014 Microsoft