TsgcWebSocketClient | Connect TCP Server

TsgcWebSocketClient can connect to WebSocket servers, but it can also connect to plain TCP Servers.

URL Property

The easiest way to connect to a TCP server is to use the URL property and set Active = true.

 

Example: connect to 127.0.0.1 port 5555


oClient := TsgcWebSocketClient.Create(nil);
oClient.URL := 'tcp://127.0.0.1:5555';
oClient.Active := true;

Host, Port and Parameters

You can connect to a TCP server using Host and port properties.

 

Example: connect to 127.0.0.1 port 5555


oClient := TsgcWebSocketClient.Create(nil);
oClient.Specifications.RFC6455 := false;
oClient.Host := '127.0.0.1';
oClient.Port := 5555;
oClient.Active := true;