RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TTcpClient.RemotePort Property

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

Pascal
property RemotePort: TSocketPort;
C++
__property TSocketPort 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 RemoteHost property, to host multiple connections simultaneously. Each combination of RemotePort and RemoteHost can only be bound to a single socket connection.  

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 LookupProtocol 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) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!