TsgcWebSocketClient | Client Send Text Message

Once the client has connected to the server, it can send text messages. To send a text message, just call the WriteData() method.

 

Send a Text Message

Call the WriteData() method to send a text message. This method is executed on the same thread from which it is called.


TsgcWebSocketClient1.WriteData('My First sgcWebSockets Message!.');

If QueueOptions.Text has a different value from qmNone, instead of being processed on the same thread that is called, it will be processed on a secondary thread. By default this option is disabled.

 

 

Send a Text Message and Wait for the Response

Call the WriteAndWaitData() method to send a text message and wait for a response from the server. The function returns the text message received.

 


TsgcWebSocketClient1.WriteAndWaitDataData('My First sgcWebSockets Message!.');