| 58 | } |
| 59 | |
| 60 | void ServerThread::stop() { |
| 61 | if (!running_) { |
| 62 | return; |
| 63 | } |
| 64 | |
| 65 | // Tell the server to stop |
| 66 | server_->stop(); |
| 67 | running_ = false; |
| 68 | |
| 69 | // Wait for the server thread to exit |
| 70 | // |
| 71 | // Note: this only works if all client connections have closed. The servers |
| 72 | // generally wait for everything to be closed before exiting; there currently |
| 73 | // isn't a way to tell them to just exit now, and shut down existing |
| 74 | // connections. |
| 75 | thread_->join(); |
| 76 | } |
| 77 | |
| 78 | void ServerThread::run() { |
| 79 | /* |
no test coverage detected