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:
parent
8534eed87d
commit
90d854759e
1 changed files with 3 additions and 0 deletions
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue