title: Reading on socket with EOT, SOH, STX among other characters
body: <p>I'm using Celluloid IO to read from sockets. The incoming message has the following syntax</p>
  
  <p>sometextsometextsometext</p>
  
  <p>where </p>
  
  <pre><code>SOH = Hex 1
  FS  = Hex 1C
  STX = Hex 2
  ETX = Hex 3
  EOT = Hex 4
  </code></pre>
  
  <p>My read code is something like this -</p>
  
  <pre><code>message = ""
  begin
    data = socket.readpartial(4096)
    message &lt;&lt; data
  end until message =~ /not sure what goes here/
  </code></pre>
  
  <p>I'm looking for a reliable way to read from the socket until EOT. Once the message is read, i'll regex out the relevant sections.</p>
  
  <p>Some guidance on detecting the above mentioned hex characters in socket read stream and in regex would be very helpful. Guidance?</p>