RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomWinSocket.RemotePort Property

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

Pascal
property RemotePort: Integer;
C++
__property int RemotePort;

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.
 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!