TsgcWebSocketClient | Client Send Binary Message

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

 

Send a Binary Message

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

 


oStream := TMemoryStream.Create(nil);
Try
  ...
  TsgcWebSocketClient1.WriteData(oStream);
Finally  
  oStream.Free;
End;

If QueueOptions.Binary 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 Binary Message and Wait for the Response

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

 


TsgcWebSocketClient1.WriteAndWaitDataData(oStream);