Windows Dev Center

StreamSocketInformation.RemotePort | remotePort property

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

Syntax


public string RemotePort { get; }

Property value

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

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

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.

Requirements (device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Networking.Sockets
Windows::Networking::Sockets [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Capabilities

ID_CAP_NETWORKING [Windows Phone]

Requirements (operating system)

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

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
RemoteServiceName
StreamSocket
StreamSocketInformation

 

 

Show:
© 2015 Microsoft