TsgcWebSocketClient | Connect TCP Server

TsgcWebSocketClient can connect to WebSocket servers but can connect to plain TCP Servers too.

URL Property

The most easy way to connect to a WebSocket server is use URL property and call 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;