[asio] what am I doing wrong with io_service::post()?

I'm adding a handler to the io_service post method, but the handler is never called. Before that, I create a thread to run in the run() method (with an async read handler to give it work to do). This is on Windows XP Pro with MSVS 2003. The thread that does the post is the UI thread and after calling post it uses a boost::condition to wait for the transmit to complete. ioservice.post(boost::bind(&nw::Connection::transmitData, this)); boost::recursive_mutex::scoped_lock syncLock(_syncWriteMutex); _syncWriteCondition.wait(syncLock); // wait for data to be transmitted void Connection::transmitData() { OUTPUT_STRING("Connection::transmitData()"); // never called } Is there some interaction between the windows message handling pump thread and IO completion ports that I'm not aware of? Does the thread need to go back into the message pump before I'll get a post() callback? Thanks, Scott

Just out of curiosity. Is transmitData() called when you are not waiting after the post? On 10/10/06, Scott <cheesy4poofs@cox.net> wrote:
I'm adding a handler to the io_service post method, but the handler is never called. Before that, I create a thread to run in the run() method (with an async read handler to give it work to do). This is on Windows XP Pro with MSVS 2003.
The thread that does the post is the UI thread and after calling post it uses a boost::condition to wait for the transmit to complete.
ioservice.post(boost::bind(&nw::Connection::transmitData, this)); boost::recursive_mutex::scoped_lock syncLock(_syncWriteMutex); _syncWriteCondition.wait(syncLock); // wait for data to be transmitted
void Connection::transmitData() { OUTPUT_STRING("Connection::transmitData()"); // never called }
Is there some interaction between the windows message handling pump thread and IO completion ports that I'm not aware of? Does the thread need to go back into the message pump before I'll get a post() callback?
Thanks, Scott
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (2)
-
Christian Henning
-
Scott