连接到 TCP 服务器最简单的方法是使用 URL 属性并将 Active = true 设置。
示例: 连接到 127.0.0.1 端口 5555
oClient := TsgcWebSocketClient.Create(nil);
oClient.URL := 'tcp://127.0.0.1:5555';
oClient.Active := true;
您可以使用 Host 和 port 属性连接到 TCP 服务器。
示例: 连接到 127.0.0.1 端口 5555
oClient := TsgcWebSocketClient.Create(nil);
oClient.Specifications.RFC6455 := false;
oClient.Host := '127.0.0.1';
oClient.Port := 5555;
oClient.Active := true;