| 125 | } |
| 126 | |
| 127 | void ODSocketServer::stopServer() |
| 128 | { |
| 129 | mIsConnected = false; |
| 130 | if(mThread != nullptr) |
| 131 | delete mThread; // Delete waits for the thread to finish |
| 132 | mThread = nullptr; |
| 133 | mSockSelector.clear(); |
| 134 | mSockListener.close(); |
| 135 | for (std::vector<ODSocketClient*>::iterator it = mSockClients.begin(); it != mSockClients.end(); ++it) |
| 136 | { |
| 137 | ODSocketClient* client = *it; |
| 138 | client->disconnect(); |
| 139 | delete client; |
| 140 | } |
| 141 | |
| 142 | mSockClients.clear(); |
| 143 | } |
nothing calls this directly
no test coverage detected