title: How to manage escape sequences?
body: <p>I'm trying to write a protocol as much simple as possible to make two processes talk through a socket. I'd like to separate control commands from raw data. How can I get this? I mean, if sockets carry only a bytes stream, how can my protocol, for example, distinguish the escape sequence "ESC STX" from the numbers sequence 2734? I've searched a bit, but not enough I suppose, since I've not yet found how to solve this problem.</p>
  
  <p>Thanks in advance.</p>