System.Win.ScktComp.TCustomWinSocket.RemotePort

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property RemotePort: Integer read GetRemotePort;

C++

__property int RemotePort = {read=GetRemotePort, nodefault};

Properties

Type Visibility Source Unit Parent
property public
System.Win.ScktComp.pas
System.Win.ScktComp.hpp
System.Win.ScktComp TCustomWinSocket

Description

Specifies the ID number of the port used by the RemoteHost to form the socket connection.

Use RemotePort to determine the port number used by the socket on the other end of the socket connection.

Port numbers allow a single system, identified by the RemoteAddress or RemoteHost property, to host multiple connections simultaneously. Each combination of RemotePort and RemoteAddress can only be bound to a single socket connection. This combination is represented by the RemoteAddr property.

Many port numbers are associated by convention with a particular service such as ftp or http. To determine whether the value of RemotePort is associated with a specific service, use the LookupService method.

Note: If a client socket requests a specific port to indicate a desired service, the value of RemotePort for the actual connection may differ from the requested port number. Most server sockets listen on the port associated with a service, but switch to an arbitrary available port number for forming connections.

See Also