title: Set timeout for boost socket.connect
body: <p>I am using <code>boost::asio::connect</code> on a <code>tcp::socket</code>.  When all goes fine, the <code>connect</code> returns immediately but on a poor network, the <code>connect</code> times out after a log wait of 15 seconds.  I cannot afford to wait that long and so want to reduce the timeout.  Unfortunately I have not come across any solution so far.  </p>
  
  <p>I see solutions where async_wait is been used together with deadline_timer but all those examples are for receive / send operations and not for connect.  </p>
  
  <p>Can anyone help me with a sample code for <code>boost::asio::connect(socket, endpoints);</code>.  Requirement is that it should timeout in 5 seconds instead of 15. </p>