timedout async operation problem in boost::asio

I'm trying to use boost::asio, and I find that there isn't a built-in timeout parameter in any async operation. I think it's a very important function when writing real life programs, and I have done some walk around work, how can I try to contribute?

On 5/18/06, 李慧霸 <magazine.lihuiba@163.com> wrote:
I'm trying to use boost::asio, and I find that there isn't a built-in timeout parameter in any async operation. I think it's a very important function when writing real life programs, and I have done some walk around work, how can I try to contribute?
Look at the example programs in the libs/asio/example/timeouts directory. You need to schedule a timer to go with your async operation. -- Caleb Epstein caleb dot epstein at gmail dot com

Hi, I've already replied in an earlier private email conversation, but for the benefit of the list...
I'm trying to use boost::asio, and I find that there isn't a built-in timeout parameter in any async operation. I think it's a very important function when writing real life programs, and I have done some walk around work, how can I try to contribute?
There isn't a way to implement timeouts on the individual async operations both efficiently and portably. E.g. the async I/O functions on windows (like AcceptEx etc) don't support timeouts. Instead, the intended approach is to use a deadline_timer object and start a timer when you start the operation. The examples under example/timeouts illustrate this. In my experience timeouts can often apply at a coarser granularity than the socket's send and receive operations. For example you might develop a high level function that receives a complex message (such as an HTTP reply) and want to set a timeout for receiving the entire message. However the implementation of this high level read function wouldn't need to be aware that a deadline_timer is being used. Cheers, Chris
participants (3)
-
Caleb Epstein
-
Christopher Kohlhoff
-
李慧霸