TsgcTCPClient › Properties › BoundPortMax

BoundPortMax Property

Upper bound of the local port range when binding the outbound connection to a range of ports.

Syntax

property BoundPortMax: TIdPort read FBoundPortMax write FBoundPortMax;

Default Value

0

Remarks

Used together with BoundPortMin to restrict the source port of the outbound socket. The client tries each port in [BoundPortMin..BoundPortMax] in turn until it finds one that can be bound. Leave both at 0 to allow any ephemeral port, or use BoundPort to pin a single value.

Example


oTCP := TsgcTCPClient.Create(nil);
oTCP.Host := 'www.esegece.com';
oTCP.Port := 2053;
oTCP.BoundPortMin := 50000;
oTCP.BoundPortMax := 50100;
oTCP.Active := true;

Back to Properties