Boost logo

Boost Users :

From: lakers fan (lakersfan74_at_[hidden])
Date: 2008-09-01 02:39:07


       As soon as I created the socket, I called async_receive_from() before io_service.run(). But run() returns immediately.
 
Thanks,
Bharani> To: boost-users_at_[hidden]> From: boriss_at_[hidden]> Date: Sun, 31 Aug 2008 00:47:02 +0200> Subject: Re: [Boost-users] problem with boost io_service> > 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 mailing list> Boost-users_at_[hidden]> http://lists.boost.org/mailman/listinfo.cgi/boost-users
_________________________________________________________________
Get thousands of games on your PC, your mobile phone, and the web with Windows®.
http://clk.atdmt.com/MRT/go/108588800/direct/01/



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