▲ | Const-me a day ago | |||||||
> you never serialize a byte by byte over the network I sometimes do for the following two use cases. 1. When the protocol delivers real-time data, I serialize byte by byte over the network to minimize latency. 2. When the messages in question are large, like 1GB or more, I don’t want to waste that much memory on both ends of the socket to buffer complete messages like ProtoBuff does. On the sending side, I want to produce the message, encode at the same time with a streaming serializer, and stream bytes directly into the socket. Similarly, on the receiving side I want to de-serialize bytes as they come with a streaming de-serializer. Without buffering the complete message on sending side, receiving side can’t know length of the message in advance before receiving the complete message, because the sender only knows the length after the complete message is serialized. | ||||||||
▲ | menaerus a day ago | parent [-] | |||||||
I still don't understand if you're really sending byte by byte over TCP/UDP or? Because that would be detrimental for performance. | ||||||||
|