Server::start-stop-start should now work given that appropriate delays are set between the operations (at least start and stop).

This commit is contained in:
eidheim 2015-11-24 10:46:51 +01:00
commit 90d854759e

View file

@ -146,6 +146,8 @@ 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++) {
@ -164,6 +166,7 @@ namespace SimpleWeb {
} }
void stop() { void stop() {
acceptor.close();
io_service.stop(); io_service.stop();
} }