title: Linux C++ TCP Socket - Enable Blocking Mode
body: <p>Amazingly, I have had a hard time finding an answer to this..</p>
  
  <p>I have a TCP client socket that I can successfully connect with and send data through.  However, after sending data, I'm expecting a response to be returned from the server.  I checked my socket and it would appear that it is in non blocking mode.</p>
  
  <pre><code>if (fcntl(sc-&gt;connect_d, F_GETFL) &amp;&amp; O_NONBLOCK)
  {
  //non blocking
  }
  </code></pre>
  
  <p>What is the macro for enabling blocking mode so I can read the server response a little easier?  Can somebody give me a small snippet that can do this?  Thanks</p>