|
Boost Users : |
Subject: Re: [Boost-users] asio, new connection handler is not called
From: Lloyd (lloyd_at_[hidden])
Date: 2010-07-07 09:10:17
By debugging one thing I recognised is, io_service::run() is called from the
main thread, and blocked thread is another one. But, in the blocked thread I
have async_read() call handler. Inside the handler the thread is blocking.
This is causing the problem.
Now I will explain the real problem. There is a data write (to the disk)
handler routine. If the disk is full I want the thread to wait until some
disk space is free.For this what I do is, in the write handler there is a
infinite while loop. Inside this thread interruption is enabled. The it
checks for free space in the disk. If it is available, it breaks the while.
Other wise it sleeps for some time, continues in the loop. Is there a better
way to handle this?
Thanks a lot,
Lloyd
----- Original Message -----
From: "Igor R" <boost.lists_at_[hidden]>
To: <boost-users_at_[hidden]>
Sent: Wednesday, July 07, 2010 3:46 PM
Subject: Re: [Boost-users] asio, new connection handler is not called
>> Now inside the thread, I have created a "thread interruption point".
>> This> thread interruption point is inside a while loop for testing, and
>> the while> loop is inside the "async_read_handler". (That is the read
>> handler never> returns - When testing code is execution control is
>> here-). By opening a new> "telnet client", I have tried to connect to the
>> listening port, it is> connected, but the async_accept handler routine is
>> not called! What could be> the reason? How can I rectify this?
> Who calls async_read_handler? Check that the thread you're blocking(with
> "while" loop) is not supposed to pump the handlers, i.e. it'snot the
> thread that executes io_service::run().
> P.S. it's worth asking asio-related question on asio mailng
> list._______________________________________________Boost-users mailing
> listBoost-users_at_[hidden]http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
______________________________________
Scanned and protected by Email scanner
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