TsgcTCPClient › Properties › BoundIP
连接前绑定客户端套接字的本地 IP 地址。
property BoundIP: string read FBoundIP write FBoundIP;
(空字符串)
通过在调用 connect() 之前将客户端套接字绑定到 BoundIP,将出站连接固定到特定的本地接口。留空则让操作系统选择任意可用接口。可与 BoundPort 结合使用,或与 BoundPortMin/BoundPortMax 结合以在端口范围内绑定。
oTCP := TsgcTCPClient.Create(nil);
oTCP.Host := 'www.esegece.com';
oTCP.Port := 2053;
oTCP.BoundIP := '192.168.1.50';
oTCP.Active := true;