title: Write to the client returns EWOULDBLOCK when server is slow
body: <p>I am trying to write some data in the socket after specific time interval. I have two threads, one thread maintaining the TCP connection, and another thread generating data. </p>
  
  <p>The data generating therad generates data, and writes it to a shared memory. The server threadreads data from the shared memory, and sends it to the client.</p>
  
  <p>But, when the data generating thread becomes slow, when a lot of calculations involved, the server thread gets a EWOULDBLOCK error when trying to write to the client. But, surprisingly, from the client side, there is no such error.</p>
  
  <p>If I am not wrong, EWOULDBLOCK error is returned when server is faster than client and the socket buffer is not completely read before it gets written again. But, here the case is totally opposite.</p>
  
  <p>Can it be because the server therad is kept on sleep till the data generation thread completes( data thread has a higher priority).</p>
  
  <p>Can somebody explain what might be happening here?</p>