Jump to content
Sign in to follow this  

Send binary stream with WebSocket

Recommended Posts

according to the API...


...the send() method can send a string, Blob, or ArrayBuffer


So you could try to use JBlob or JArrayBuffer (from lib.Core.pas)


And there is something with JWebsocket.binaryType you can do:


Share this post

Link to post
Share on other sites

I have made a copy from lib.Core and renamed part of it. I have tried to create a ArrayBuffer with UInt8Array.set and UInt8Array.new but it doesent compile through the creation ?


procedure TFmClient.Bt_SendBinaryClick(Sender: TObject); 
  n  : Integer; 
  A  : array of integer; 

  ArrayBuffer : JArrayBuffer2; 
  UInt8       : JUInt8Array2; 
  BufferView  : JArrayBufferView2; 
  UInt8_Core  : JUint8Array_Core; 
// ws.binaryType:='ArrayBuffer'; 

  for n:=0 to 7 do A[n]:=n; 

  memo1.text:='Done '; 

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this