TsgcWebSocketClient | Client Send Binary Message

Once client has connected to server, it can send Binary Messages to server. To send a Text Message, just call WriteData() method and send your binary message.

 

Send a Binary Message

Call To WriteData() method and send a Binary message. This method is executed on the same thread that 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 be 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 the Response

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

 


TsgcWebSocketClient1.WriteAndWaitDataData(oStream);