Boost logo

Boost Users :

From: Boris (boriss_at_[hidden])
Date: 2008-08-30 18:47:02


On Sat, 30 Aug 2008 12:41:52 +0200, lakers fan <lakersfan74_at_[hidden]> wrote:

>
> Hello,
> I have an application in which I created an io_service object in
> the main thread of the application. Then I created a listener object
> (listener socket class), this class creates a new worker thread and
> waits for incoming messages. First I created listener socket in the
> context of the main thread and called async_receive_from() so that
> io_service has something to work, and then I called io_service.run() in
> the worker thread. But the run() returned immediately. So I tried
> creating the socket in the worker thread and called
> async_receive_from() and then called io_service.run(). Again run()
> returned immeidately with boost::system::error_code's m_val = 0.
> Can someone point me in the right direction? i m kind of clueless..

Is it possible that your handler which you passed to async_receive_from()
was called? If you don't call async_receive_from() then again from your
handler the io_service has no work to do anymore (and run() returns).

Boris


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