Hello there,
I made a small sample application (ASP.NET Core 2.2) to demonstrate how to push images from server to client. Here it is: it's using ASP.NET Core SignalR and MessagePack as the protocol.
https://github.com/BrightSoul/aspnetcore-realtime-binary
The application is indeed working but I've noticed that my byte[] payload is being inflated by 33% when going through the websockets transport with the MessagePack protocol.

No matter the size: if I send 1000 bytes, the client receives 1333+ bytes.
If I send 10000 bytes, the client receives 13333+ bytes.
Unfortunately, Chome doesn't let me peek at a binary payload. I might have to use Wireshark to see what's inside.
Is the payload, by any chance, encoded in base64? Would you explain why I'm observing this?
MessagePack should be able to handle binary payloads wihtout base64 encoding, according to specification.
Thanks
There鈥檚 framing surrounding your message (dispatch data to invoke the right callback). That includes the method name, argument count, type of invocation. These are all stored in a msg pack array itself so that adds some framing as well.
Thank you for your answer.
There鈥檚 framing surrounding your message
Indeed, but why is that proportional to the payload size?
Look at this: when I send 100k bytes, the client receives 133k bytes.

@davidfowl Nevermind, I think it's just Google Chrome that's reporting the wrong length (but I don't know why).
When I inspect the frames using Fiddler, then it reports che correct size. These are some frames with a 1000 byte payload. A small overhead (method name, etc), followed by zeros (the payload).

I'm sorry for the fuss, I was misled by what I saw on Google Chrome.
Glad you figured it out! Thanks for trying out Messagepack :)
Glad you figured it out! Thanks for trying out Messagepack :)
Yeah, it's great!
Most helpful comment
Glad you figured it out! Thanks for trying out Messagepack :)