tehmoon / cryptocli

The ultimate tool for data transfer, manipulation and proxy.
MIT License
16 stars 2 forks source link

(DRAFT) Length value for MessageChannel #66

Closed tehmoon closed 4 years ago

tehmoon commented 4 years ago

When a MessageChannel is converted to a reader it looses the original message length because the reader might not request reading all of the payload from the channel. But it's important to preserve the original length of the payload just because some modules are message oriented. For example, websocket will emit one payload per websocket message. If one function reads from a channel reader, it won't have the ability to restore that entire message.

This is why it could be useful to migrate all message channels to add the length of the payload in uint32 little endian. The reader could just read the 4 first bytes and decide either it wants to read up to the length or not.

tehmoon commented 4 years ago

Addressed by #67 which has a refactored bytes module with the new ChannelMessage.