summaryrefslogtreecommitdiffstats
path: root/src/remoteobjects/qremoteobjectsourceio.cpp
diff options
context:
space:
mode:
authorØystein Heskestad <oystein.heskestad@qt.io>2023-07-31 17:40:29 +0200
committerØystein Heskestad <oystein.heskestad@qt.io>2023-09-11 10:21:35 +0200
commit8ddef5b073e86eb474eb5c28f09ae1d497d03593 (patch)
treebb3ce63af1a1dcae6311a6a13f82b4832181cdf5 /src/remoteobjects/qremoteobjectsourceio.cpp
parent2bdde103158b4c0220584816653eb64e5d456b0f (diff)
Add a static method setLocalServerOptions to QRemoteObjectHost
This method must be called before a QRemoteObjectHost object using the QLocalServer backend starts listening for it to have an effect. It starts listening during construction when the address argument is non-empty, otherwise when the address is set via setHostUrl(). Also added another error code QRemoteObjectNode::SocketAccessError for when the QRemoteobjectNode is not allowed to connect to the QRemoteObjectHost. Fixes: QTBUG-72921 Change-Id: I4303b25dbc37d9f4d4eb2bdaeff1ef02089e6b5d Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
Diffstat (limited to 'src/remoteobjects/qremoteobjectsourceio.cpp')
-rw-r--r--src/remoteobjects/qremoteobjectsourceio.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/remoteobjects/qremoteobjectsourceio.cpp b/src/remoteobjects/qremoteobjectsourceio.cpp
index 0b14999..ebc4654 100644
--- a/src/remoteobjects/qremoteobjectsourceio.cpp
+++ b/src/remoteobjects/qremoteobjectsourceio.cpp
@@ -8,6 +8,7 @@
#include "qremoteobjectnode_p.h"
#include "qremoteobjectpendingcall.h"
#include "qtremoteobjectglobal.h"
+#include "qconnection_local_backend_p.h"
#include <QtCore/qstringlist.h>
@@ -86,6 +87,19 @@ bool QRemoteObjectSourceIo::disableRemoting(QObject *object)
return true;
}
+void QRemoteObjectSourceIo::setSocketOptions(QLocalServer::SocketOptions options)
+{
+ if (!m_server.isNull()) {
+ LocalServerImpl *server = qobject_cast<LocalServerImpl *>(m_server.get());
+ if (server != nullptr) {
+ server->setSocketOptions(options);
+ } else {
+ qROWarning(this)
+ << "Attempting to set socket options to a backend that is non-localserver";
+ }
+ }
+}
+
void QRemoteObjectSourceIo::registerSource(QRemoteObjectSourceBase *source)
{
Q_ASSERT(source);