Boost logo

Boost Users :

From: Jose Martinez (jmartine_1026_at_[hidden])
Date: 2008-05-24 12:41:23


Igor,

Thanks a lot. I figured they must be a way to do it; that work class slipped by me unnoticed on the reference page. It seems like they thought of everything.

thanks

> My question is how do I keep the thread's
io_service.run() from returning right away, since there will be no work
for the io_service.run() to do until the server lines up a new
connection for the thread to handle?

Use asio::io_service::work class:
http://www.boost.org/doc/libs/1_35_0/doc/html/boost_asio/reference/io_service__work.html
Look at the following example for details:
http://www.boost.org/doc/libs/1_35_0/doc/html/boost_asio/example/http/server2/io_service_pool.cpp
 jose
"survival first, then happiness as we can manage it"

      


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