summaryrefslogtreecommitdiffstats
path: root/src/remoteobjects/qconnectionfactories.cpp
diff options
context:
space:
mode:
authorBogDan Vatra <bogdan@kdab.com>2017-11-17 16:28:28 +0200
committerBogDan Vatra <bogdan@kdab.com>2017-12-08 17:28:03 +0000
commit9ae28ac68af20b4d8b305fa78a478833cc833642 (patch)
tree2e633b38453597e7b7bff60dafd61a3f54b31304 /src/remoteobjects/qconnectionfactories.cpp
parentf101d41c8f7d2068e168f3bc967cde74aeae7f4c (diff)
Say hello to QRemoteObjectNode::heartbeatInterval property
This property can be used to periodically check the connection between the replica and the source. If the connection is lost, the replica enters in the "Suspect" state and will attempt to reconnect. Task-number: QTBUG-64086 Change-Id: Icf67e173073c9d277575c8faf01a0a1ffab5bc07 Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
Diffstat (limited to 'src/remoteobjects/qconnectionfactories.cpp')
-rw-r--r--src/remoteobjects/qconnectionfactories.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/remoteobjects/qconnectionfactories.cpp b/src/remoteobjects/qconnectionfactories.cpp
index e2bd071..583f800 100644
--- a/src/remoteobjects/qconnectionfactories.cpp
+++ b/src/remoteobjects/qconnectionfactories.cpp
@@ -76,6 +76,8 @@ inline bool fromDataStream(QDataStream &in, QRemoteObjectPacketTypeEnum &type, Q
case InvokeReplyPacket: type = InvokeReplyPacket; break;
case PropertyChangePacket: type = PropertyChangePacket; break;
case ObjectList: type = ObjectList; break;
+ case Ping: type = Ping; break;
+ case Pong: type = Pong; break;
default:
qCWarning(QT_REMOTEOBJECT_IO) << "Invalid packet received" << type;
}
@@ -105,6 +107,12 @@ void ClientIoDevice::close()
doClose();
}
+void ClientIoDevice::disconnectFromServer()
+{
+ doDisconnectFromServer();
+ emit shouldReconnect(this);
+}
+
bool ClientIoDevice::read(QRemoteObjectPacketTypeEnum &type, QString &name)
{
qCDebug(QT_REMOTEOBJECT_IO) << "ClientIODevice::read()" << m_curReadSize << bytesAvailable();