Possible Duplicate:
How to set a timeout on blocking sockets in boost asio?
I read some of the entries before about the timeout but I don't understand.
I want a defined timeout for the connection. the connect code looks like:
try{
  boost::asio::ip::tcp::resolver              resolver(m_ioService);
  boost::asio::ip::tcp::resolver::query       query(link.get_host(), link.get_scheme());
  boost::asio::ip::tcp::resolver::iterator    endpoint_iterator = resolver.resolve(query);
  boost::asio::ip::tcp::resolver::iterator    end;
  boost::system::error_code                   error   =   boost::asio::error::host_not_found;
  while (error && endpoint_iterator != end)
   {
    m_socket.close();
    m_socket.connect(*endpoint_iterator++, error);
   }
}
also I want a read timeout.
I use boost::asio::read_until(m_socket, response, "\r\n"); for read the header.
is it possible to set SIMPLE a timeout?
 
     
     
    