Add message framing options to the socket inputs and outputs
I would like to suggest adding a new framing option to the socket inputs and outputs.
On output sockets the framing should work like the existing appending codecs append, lines, and delim, but with the specified framing written before and/or after appending the message.
On input sockets there should be a matching scanner that can read and understand the framing.
With inspiration from the existing delim:x codec, various framing types could be specified like this:
framing:length
The byte size of the message is written as an int32 before the message.
framing:tags
Optional fixed before and/or after tags are written before and after the message.
framing:header
A more advanced framing where a custom header is written before the message. The custom header could be a string or any field or metadata field from the input or a processor.
My use case: I would like to make a connection between Bento and an application using local unix sockets. Then from an application I can pass messages to and from Bento and use it's amazing powers of inputs, processing, and outputs. A simple framing scheme on the socket connection makes handling messages of different sizes much easier.