mirror of https://github.com/nymea/nymea.git
Use close() instead of abort() when dropping clients
parent
1329fab9a6
commit
dd32a187c3
|
|
@ -86,7 +86,7 @@ void BluetoothServer::terminateClientConnection(const QUuid &clientId)
|
|||
{
|
||||
QBluetoothSocket *client = m_clientList.value(clientId);
|
||||
if (client) {
|
||||
client->abort();
|
||||
client->close();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ void TcpServer::terminateClientConnection(const QUuid &clientId)
|
|||
{
|
||||
QTcpSocket *client = m_clientList.value(clientId);
|
||||
if (client) {
|
||||
client->abort();
|
||||
client->close();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ void WebSocketServer::terminateClientConnection(const QUuid &clientId)
|
|||
{
|
||||
QWebSocket *client = m_clientList.value(clientId);
|
||||
if (client) {
|
||||
client->abort();
|
||||
client->close();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue