Closed TinkerWorX closed 2 years ago
Looking at the code, probably. I'll write up a fix and comment when its updated.
Hi @TinkerWorX , This was a good request. I've added in support for sending raw bytes. There is a new overload for SendAsync() in client and server. However, use caution - https://docs.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/5.0/binaryformatter-serialization-obsolete. Its typically better to send a string of json / xml over sending raw bytes because of the risk of malicious polymorphic serialization / deserialization. Thank you!
Appreciate the work and the word of caution. Fortunately I'm just using it for a game to stream various state objects with a very limited protocol.
As the title asks, is it possible to send raw bytes? I would like to avoid the overhead and allocation of converting everything to strings. On the JavaScript side it is possible to use ArrayBuffer and the different low level array types(DataView, etc) with websockets.