title: Missing 0xF and 0x16 when binary data through virtual serial port pair created by socat
body: <p>I have used following command to create a pair for serial port and trying to send binary data across them.</p>
  
  <pre><code>sudo socat -d -d pty,link=/dev/tty.vcp0,raw,echo=0,user=myusername,group=staff pty,link=/dev/tty.vcp1,raw,echo=0,user=myusername,group=staff
  </code></pre>
  
  <p>However, even I try to send follow binary file</p>
  
  <p>data.bin</p>
  
  <pre><code>0x16 0x16 0x16 0x16 0x16 0x16
  </code></pre>
  
  <p>(basically just a file with 6 bytes, each byte has value 0x16)</p>
  
  <p>by</p>
  
  <pre><code>cat /dev/tty.vcp0 &gt; recv.bin
  </code></pre>
  
  <p>and </p>
  
  <pre><code>cat data.bin &gt; /dev/tty.vcp1
  </code></pre>
  
  <p>And what I get is just 3 bytes of 0x16 instead of 6.</p>
  
  <p>Similar thing happen on byte 0xF. If I send a binary file with 6 bytes of 0xF, I can't received any single byte.</p>
  
  <p>Anyone know what is causing the missing 0x16 and 0xF?
  How can I transfer binary data which contain 0x16 and 0xF?</p>
  
  <p>Other test case:</p>
  
  <p><strong>Test case 1</strong></p>
  
  <p>Send:</p>
  
  <pre><code>0x16 0x16 0x16 0x0 0x0 0x0 0x0 0x16 0x16 0x16
  </code></pre>
  
  <p>Receive: </p>
  
  <pre><code>0x16 0x0 0x0 0x0 0x0 0x16
  </code></pre>
  
  <p><strong>Test case 2</strong></p>
  
  <p>Send:</p>
  
  <pre><code>0xf 0xf 0xf 0x0 0x0 0x0 0x0 0xf 0xf 0xf
  </code></pre>
  
  <p>Receive: </p>
  
  <pre><code>0xf 0x0 0x0 0x0 0x0
  </code></pre>
  
  <p>I have added -x option in the socat command, and I can see the correct data being displayed, so it should the receive side's problem. </p>
  
  <p>P.S. All of the above tests are carried out on Mac OS X 10.9.2</p>