History

Minor polish, remove debug log

Ada committed 10 months ago

Commit 90acc811 parent a4134b32 files · +10 −8Browse files

Showing the changes to interface/src/scripting/OSCScriptingInterface.cpp (1 of 2 files). Show all

Unified · Split

interface/src/scripting/OSCScriptingInterface.cpp+7−7
@@ -181,11 +181,14 @@ OSCScriptingInterface::OSCScriptingInterface(QObject* parent) : · 180 unmodified lines
181181 _sendHost("osc/sendHost", "127.0.0.1"),
182182 _socket(std::make_shared<QUdpSocket>(this))
183183 {
184− _socket->bind(QHostAddress(_receiveHost.get()), _receivePort.get());
185−
186− connect(_socket.get(), &QUdpSocket::readyRead, this, &OSCScriptingInterface::readPacket);
184+ connect(_socket.get(), &QUdpSocket::readyRead, this, [this] {
185+ // multiple datagrams might arrive at once
186+ while (_socket->hasPendingDatagrams()) {
187+ readPacket();
188+ }
189+ });
187190
188− qCInfo(osc_cat) << "Listening on" << _socket->localAddress() << ":" << _socket->localPort();
191+ rebindSocket();
189192 }
190193
191194 OSCScriptingInterface::~OSCScriptingInterface() {
@@ -361,7 +364,6 @@ ScriptValue OSCScriptingInterface::sendPacket(ScriptContext* context, ScriptEngi · 169 unmodified lines
361364 arguments.append(context->argument(i).toVariant());
362365 }
363366
364−
365367 if (address == "#bundle") {
366368 engine->raiseException("OSC bundles are not supported");
367369 return engine->undefinedValue();
@@ -473,8 +475,6 @@ ScriptValue OSCScriptingInterface::sendPacket(ScriptContext* context, ScriptEngi · 105 unmodified lines
473475
474476 instance->_socket->writeDatagram(bytes, QHostAddress(instance->_sendHost.get()), instance->_sendPort.get());
475477
476− qCDebug(osc_cat) << QHostAddress(instance->_sendHost.get()) << instance->_sendPort.get() << ":" << bytes.toHex(' ');
477−
478478 return engine->undefinedValue();
479479 }
480480