TsgcTCPClient › Properties › BoundPort

BoundPort Property

Local TCP port the client socket is bound to before connecting.

Syntax

property BoundPort: TIdPort read FBoundPort write FBoundPort;

Default Value

0

Remarks

Fixes the ephemeral source port used by the outbound connection. A value of 0 lets the operating system allocate any free port. Use a specific value when a firewall or peer requires a known source port. If you need to bind within a range instead of a single port, set BoundPortMin and BoundPortMax and leave BoundPort at 0.

Example


oTCP := TsgcTCPClient.Create(nil);
oTCP.Host := 'www.esegece.com';
oTCP.Port := 2053;
oTCP.BoundIP := '192.168.1.50';
oTCP.BoundPort := 54321;
oTCP.Active := true;

Back to Properties