summaryrefslogtreecommitdiffstats
path: root/src/remoteobjects/qremoteobjectnode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/remoteobjects/qremoteobjectnode.cpp')
-rw-r--r--src/remoteobjects/qremoteobjectnode.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/remoteobjects/qremoteobjectnode.cpp b/src/remoteobjects/qremoteobjectnode.cpp
index f095e1e..5d86605 100644
--- a/src/remoteobjects/qremoteobjectnode.cpp
+++ b/src/remoteobjects/qremoteobjectnode.cpp
@@ -1337,6 +1337,7 @@ void QRemoteObjectNodePrivate::onClientRead(QObject *obj)
\value MissingObjectName The given QObject does not have objectName() set.
\value HostUrlInvalid The given url has an invalid or unrecognized scheme.
\value ProtocolMismatch The client and the server have different protocol versions.
+ \value ListenFailed Can't listen on the specified host port.
*/
/*!
@@ -1599,6 +1600,13 @@ bool QRemoteObjectHostBase::setHostUrl(const QUrl &hostAddress, AllowedSchemas a
}
d->remoteObjectIo = new QRemoteObjectSourceIo(hostAddress, this);
+ if (allowedSchemas == AllowedSchemas::BuiltInSchemasOnly && !d->remoteObjectIo->startListening()) {
+ d->setLastError(ListenFailed);
+ delete d->remoteObjectIo;
+ d->remoteObjectIo = nullptr;
+ return false;
+ }
+
//If we've given a name to the node, set it on the sourceIo as well
if (!objectName().isEmpty())
d->remoteObjectIo->setObjectName(objectName());