RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomWinSocket.LocalPort Property

Specifies the ID number of the port used by the socket connection.

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

Use LocalPort to determine the port number that is bound to the socket connection. For server endpoints of listening connections, LocalPort is the ID associated with the service the server socket provides. For client or server endpoints of connections to another socket, LocalPort is usually an arbitrary value picked when the connection was made. 

Port numbers allow a single system, identified by the LocalAddress property, to host multiple connections simultaneously. Each combination of LocalPort and LocalAddress can only be bound to a single socket connection. This combination is represented by the Addr property. 

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

 

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