base64 is the preferred way but any 8-bit encoding that doesn't use LF would also work.
There is no support for a length header or chunking as SSMP is designed with small messages in mind.
There is no support for a length header or chunking as SSMP is designed with small messages in mind.
This is one of the most annoying things about XMPP (even sending contact photos hits this!), so if replacing XMPP ...
If you're going for telnet compatibility then you'll want to terminate packets in CR+LF, but possibly expect to see only CR or LF from the client (ASCII mode).
Your stream could either be stateful (a message is always sent complete and in order, even if it takes multiple stream packets) or stateless* (different messages might have stream packets consecutively).
It would be more future proof if you started with a message grammar and then defined your protocol on top of that.