TsgcTCPClient › Properties › BoundPortMax
Upper bound of the local port range when binding the outbound connection to a range of ports.
property BoundPortMax: TIdPort read FBoundPortMax write FBoundPortMax;
0
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.
oTCP := TsgcTCPClient.Create(nil);
oTCP.Host := 'www.esegece.com';
oTCP.Port := 2053;
oTCP.BoundPortMin := 50000;
oTCP.BoundPortMax := 50100;
oTCP.Active := true;