Share via


StreamSocketInformation.RemotePort Property

Definition

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

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

Property Value

String

Platform::String

winrt::hstring

The TCP port number of the remote network endpoint after a connection is established.

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 RemoteServiceName property represents the remote service name or TCP port number for the remote network destination associated with a StreamSocket object. The RemoteHostName and RemoteServiceName properties are passed to the ConnectAsync method on the StreamSocket to establish a connection.

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. Before a connection is established, the RemoteAddress property is null and the RemotePort property contains an empty string.

Applies to

See also