|
Boost Users : |
From: Igor R (boost.lists_at_[hidden])
Date: 2008-07-27 09:56:48
> I am having a little trouble getting my boost::ASIO TCP client to actually
> re-attempt a connected if the first attempt failed. With my server offline,
> the call to async_connect correctly times out. When I try the async_connect
> call a second time, it doesn't time out.
It's unclear from your code where/how you try to re-connect. IIUC,
your HandleConnect() function doesn't reconnect, but just iterates
over the endpoints that you were given by the address resolver...
So if you've got 1 endpoint, then the 1st time you get into
HandleConnect with some error - you call DoClose(), and if the
io_service has no more work, it just ends (with the whole thread).
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net