You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just trying to learn, Is there a reason the send method only supports ArrayBuffer. I know I can convert string to ArrayBuffer with TextEncoder and vice versa but it's additional steps since I only need to send simple two characters messages. Is it more performant than sending strings directly? My use case is sending simple two character string with lowest latency possible.
The text was updated successfully, but these errors were encountered:
If you choose to work with the constraint, you can compare the performance of converting the messages to ArrayBuffer ahead of time to encoding them as messages are sent (I'm assuming that all possible values are known to you). I suspect you will not see much of a difference, but you can't know without testing.
I don't know the details of P2Pcf, or simple-peer, but WebRTC DataChannels can send strings, typed arrays, or blobs.
WebRTC has two (actually 4) data message types: string or binary. Receiving a string message results in a js string as the data property, while receiving a binary message will produce either an ArrayBuffer or Blob based on the binaryType property set by the receiver.
If there's a constraint to only ArrayBuffers, I think it's higher in the stack than the WebRTC API.
Just trying to learn, Is there a reason the send method only supports ArrayBuffer. I know I can convert string to ArrayBuffer with TextEncoder and vice versa but it's additional steps since I only need to send simple two characters messages. Is it more performant than sending strings directly? My use case is sending simple two character string with lowest latency possible.
The text was updated successfully, but these errors were encountered: