title: C socket - consecutive read/write, what happens?
body: <p>In a server/client in C, TCP, what happens if I do consecutive read/write in my program? Is this possibile, or do I've always to follow the structure "client write->server read->server write->client read"?</p>
  
  <p>Is it possible to do something like this? Or is it possible that data from the 3rd write in the server are received from the 2nd read in the client, and other bad things like this?</p>
  
  <p>client.c</p>
  
  <pre><code>write (1)
  read (2)
  read (3)
  read (4)
  </code></pre>
  
  <p>server.c</p>
  
  <pre><code>read (1)
  write (2)
  write (3)
  write (4)
  </code></pre>