Boost logo

Boost Users :

Subject: Re: [Boost-users] [asio] Callbacks not getting called
From: Rutger ter Borg (rutger_at_[hidden])
Date: 2010-03-12 09:04:10


Tom Kent wrote:

>
> So, I tried it, but surprisingly, it didn't make any difference. I'm
> not sure why there wasn't an error, it seems like one of HandleAccept
> and &HandleAccept would cause some type of error.
>
> Also, I'm not having the problem getting through the acceptor. The
> server successfully gets the accept callback for the connection from the
> client (and the client gets its callback as well). Its the
> aysnc_send/async_read that doesn't ever get a callback. I tried using
> the reference to HandleAccept in those as well, but like I said above,
> saw the *exact* same results.
>
> Tom

IIRC, an io_service object is not permitted to make copies of arguments
supplied to initiating functions outside its own thread. In your example,
you initiate an asynchronous operation from thread A (async_accept), and
io_service runs in thread B (io_service.run()).

At least, that's if I understood http://tinyurl.com/yhw95xj correctly, the
section about whether or not Asio is allowed to make copies of your supplied
arguments.

Cheers,

Rutger


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