diff --git a/gvr-interface/res/drawable/icon.png b/gvr-interface/res/drawable/icon.png index 48697e7bf4..4fe5404c7d 100644 Binary files a/gvr-interface/res/drawable/icon.png and b/gvr-interface/res/drawable/icon.png differ diff --git a/gvr-interface/src/GVRInterface.cpp b/gvr-interface/src/GVRInterface.cpp index 1253eb9aa4..c69c556b25 100644 --- a/gvr-interface/src/GVRInterface.cpp +++ b/gvr-interface/src/GVRInterface.cpp @@ -17,4 +17,30 @@ GVRInterface::GVRInterface(int argc, char* argv[]) : QGuiApplication(argc, argv) { NodeList* nodeList = NodeList::createInstance(NodeType::Agent); + + connect(&nodeList->getNodeSocket(), &QUdpSocket::readyRead, this, &GVRInterface::processDatagrams); + + QTimer* domainServerTimer = new QTimer(this); + connect(domainServerTimer, &QTimer::timeout, nodeList, &NodeList::sendDomainServerCheckIn); + domainServerTimer->start(DOMAIN_SERVER_CHECK_IN_MSECS); + + QTimer* silentNodeRemovalTimer = new QTimer(this); + connect(silentNodeRemovalTimer, &QTimer::timeout, nodeList, &NodeList::removeSilentNodes); + silentNodeRemovalTimer->start(NODE_SILENCE_THRESHOLD_MSECS); +} + +void GVRInterface::processDatagrams() { + NodeList* nodeList = NodeList::getInstance(); + + HifiSockAddr senderSockAddr; + QByteArray incomingPacket; + + while (nodeList->getNodeSocket().hasPendingDatagrams()) { + incomingPacket.resize(nodeList->getNodeSocket().pendingDatagramSize()); + nodeList->getNodeSocket().readDatagram(incomingPacket.data(), incomingPacket.size(), + senderSockAddr.getAddressPointer(), senderSockAddr.getPortPointer()); + + qDebug() << "Processing a packet!"; + nodeList->processNodeData(senderSockAddr, incomingPacket); + } } \ No newline at end of file diff --git a/gvr-interface/src/GVRInterface.h b/gvr-interface/src/GVRInterface.h index af7f46f933..b318dabedd 100644 --- a/gvr-interface/src/GVRInterface.h +++ b/gvr-interface/src/GVRInterface.h @@ -18,6 +18,8 @@ class GVRInterface : public QGuiApplication { Q_OBJECT public: GVRInterface(int argc, char* argv[]); +private slots: + void processDatagrams(); }; #endif // hifi_GVRInterface_h diff --git a/libraries/networking/src/NodeList.cpp b/libraries/networking/src/NodeList.cpp index 73a63077e9..d0728b0bb5 100644 --- a/libraries/networking/src/NodeList.cpp +++ b/libraries/networking/src/NodeList.cpp @@ -268,6 +268,7 @@ bool NodeList::processSTUNResponse(const QByteArray& packet) { } void NodeList::sendDomainServerCheckIn() { + qDebug() << "SEND DOMAIN SERVER CHECK IN"; if (_publicSockAddr.isNull() && !_hasCompletedInitialSTUNFailure) { // we don't know our public socket and we need to send it to the domain server // send a STUN request to figure it out @@ -276,6 +277,8 @@ void NodeList::sendDomainServerCheckIn() { handleICEConnectionToDomainServer(); } else if (!_domainHandler.getIP().isNull()) { + qDebug() << "SENDING A CHECK IN TO" << _domainHandler.getIP().toString(); + bool isUsingDTLS = false; PacketType domainPacketType = !_domainHandler.isConnected()