Use close() instead of abort() when dropping clients

pull/177/head
Michael Zanetti 2019-06-18 15:02:03 +02:00
parent 1329fab9a6
commit dd32a187c3
4 changed files with 7 additions and 4 deletions

View File

@ -86,7 +86,7 @@ void BluetoothServer::terminateClientConnection(const QUuid &clientId)
{
QBluetoothSocket *client = m_clientList.value(clientId);
if (client) {
client->abort();
client->close();
}
}

View File

@ -109,7 +109,7 @@ void TcpServer::terminateClientConnection(const QUuid &clientId)
{
QTcpSocket *client = m_clientList.value(clientId);
if (client) {
client->abort();
client->close();
}
}

View File

@ -113,7 +113,7 @@ void WebSocketServer::terminateClientConnection(const QUuid &clientId)
{
QWebSocket *client = m_clientList.value(clientId);
if (client) {
client->abort();
client->close();
}
}

View File

@ -64,7 +64,10 @@
/*! \fn void nymeaserver::TransportInterface::terminateClientConnection(const QUuid &clientId);
Pure virtual method for terminating \a clients connection. The JSON RPC server might call this when a
client violates the protocol. Transports should immediately abort the connection to the client.
client violates the protocol. Transports should close the connection to the client.
IMPORTANT: Any pending outgoing buffers should be sent before termination. This is important for clients
to receive error messages when the server terminates the connection because of and error. I.e. do not
abort the connection but close it after flushing outgoing buffers.
*/
/*! \fn void nymeaserver::TransportInterface::dataAvailable(const QUuid &clientId, const QByteArray &data);