diff options
authorAndre Hartmann <>2019-11-08 22:05:00 +0100
committerAndre Hartmann <>2019-11-22 19:18:57 +0100
commit95bda423b61733c5f8780c4b61e3bc62f9fa17c2 (patch)
parent0606a2215e0c11debaf5547babccbdc40321c182 (diff)
VirtualCAN: Fix disconnecting from bus
While the client sent a disconnect command to the server, this was not handled on server side. Thus, the client was never really Unconnected and in turn it was not possible to connect again. Fix that by closing the socket, that leads to VirtualCanBackend::clientDisconnected() being called and that sets the plugin to Unconnected. In any case, the server keeps running until the plugin is unloaded, even after the last client is disconnected. [ChangeLog][VirtualCAN] Fixed that the plugin stayed forever in closing state and subsequent connect calls always failed. Change-Id: I7a490c55a3cb6bd193ba4783b48d1385aa85bcde Reviewed-by: Denis Shienkov <> Reviewed-by: Rolf Eike Beer <> Reviewed-by: Alex Blasche <> (cherry picked from commit f47b712057676de6115d7320cbbc2eb9b20c9817)
1 files changed, 1 insertions, 0 deletions
diff --git a/src/plugins/canbus/virtualcan/virtualcanbackend.cpp b/src/plugins/canbus/virtualcan/virtualcanbackend.cpp
index 0057d9f..597ef14 100644
--- a/src/plugins/canbus/virtualcan/virtualcanbackend.cpp
+++ b/src/plugins/canbus/virtualcan/virtualcanbackend.cpp
@@ -139,6 +139,7 @@ void VirtualCanServer::readyRead()
QStringList list = interfaces.toStringList();
readSocket->setProperty("interfaces", list);
+ readSocket->disconnectFromHost();
} else {
const QByteArrayList commandList = command.split(':');