Close client connection on stop

This commit is contained in:
Paulchen Panther 2018-12-20 15:16:23 +01:00 committed by GitHub
parent a78d8d3a03
commit e3be03ea73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -64,6 +64,12 @@ void QtHttpServer::start (quint16 port) {
void QtHttpServer::stop (void) {
if (m_sockServer->isListening ()) {
m_sockServer->close ();
// disconnect clients
const QList<QTcpSocket*> socks = m_socksClientsHash.keys();
for(auto sock : socks)
{
sock->close();
}
emit stopped ();
}
}