Moved io_service.reset before endpoint and acceptor setup.
This commit is contained in:
parent
90d854759e
commit
b273602032
1 changed files with 3 additions and 2 deletions
|
|
@ -134,6 +134,9 @@ namespace SimpleWeb {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(io_service.stopped())
|
||||||
|
io_service.reset();
|
||||||
|
|
||||||
std::unique_ptr<boost::asio::ip::tcp::endpoint> endpoint;
|
std::unique_ptr<boost::asio::ip::tcp::endpoint> endpoint;
|
||||||
if(config.address.size()>0)
|
if(config.address.size()>0)
|
||||||
endpoint=std::unique_ptr<boost::asio::ip::tcp::endpoint>(new boost::asio::ip::tcp::endpoint(boost::asio::ip::address::from_string(config.address), config.port));
|
endpoint=std::unique_ptr<boost::asio::ip::tcp::endpoint>(new boost::asio::ip::tcp::endpoint(boost::asio::ip::address::from_string(config.address), config.port));
|
||||||
|
|
@ -146,8 +149,6 @@ namespace SimpleWeb {
|
||||||
|
|
||||||
accept();
|
accept();
|
||||||
|
|
||||||
if(io_service.stopped())
|
|
||||||
io_service.reset();
|
|
||||||
//If num_threads>1, start m_io_service.run() in (num_threads-1) threads for thread-pooling
|
//If num_threads>1, start m_io_service.run() in (num_threads-1) threads for thread-pooling
|
||||||
threads.clear();
|
threads.clear();
|
||||||
for(size_t c=1;c<config.num_threads;c++) {
|
for(size_t c=1;c<config.num_threads;c++) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue