title: Using timeouts on socket send() and recv()
body: <p>Is it a good idea to ALWAYS use either select() or poll() and impose say a 10 second timeout on both send() and recv() calls? Or should I just allow them to block indefinitely?</p>
  
  <p>Does imposing this sort of timeout (using select() or poll()) lead me to lose some sort of error reporting or functionality (in the form of return values) that I can get when just using send() and recv()?</p>
  
  <p>NOTE : Assuming I poll in the same thread right before I call recv() or send(). And the call to poll() is statically well formatted, i.e. The parameters dont change dynamically besides how they do based on the invocation of the wrapped recv() or send()</p>
  
  <p>ANOTHER NOTE : If there is a timeout, then I will throw an exception and let the programmer catch it. I was hoping this would lead to protection against a DOS attack. If there is indeed a timeout. I will throw an exception and not get to calling either recv() or send()</p>
  
  <p>YET ANOTHER NOTE : Source code related to what I am talking about can be found here <a href="https://beej.us/guide/bgnet/output/html/singlepage/bgnet.html#faq" rel="nofollow">https://beej.us/guide/bgnet/output/html/singlepage/bgnet.html#faq</a> under a similar FAQ</p>
  
  <p>Thanks!</p>