System.Win.ScktComp.TCustomWinSocket.LocalPort

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property LocalPort: Integer read GetLocalPort;

C++

__property int LocalPort = {read=GetLocalPort, 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 socket connection.

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.

See Also