From 1a1ae43bc75e20f73da7ad0f67f8a6c6c7cd4bc9 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Fri, 3 Oct 2014 09:02:18 -0700 Subject: [PATCH] send back to the network peer on established sock addr if it exists --- domain-server/src/DomainServer.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 13490b3c7b..2f74159e25 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -708,6 +708,13 @@ void DomainServer::sendDomainListToNode(const SharedNodePointer& node, const Hif DomainServerNodeData* nodeData = reinterpret_cast(node->getLinkedData()); LimitedNodeList* nodeList = LimitedNodeList::getInstance(); + + // if we've established a connection via ICE with this peer, use that socket + // otherwise just try to reply back to them on their sending socket (although that may not work) + HifiSockAddr destinationSockAddr = _connectedICEPeers.value(node->getUUID()); + if (destinationSockAddr.isNull()) { + destinationSockAddr = senderSockAddr; + } if (nodeInterestList.size() > 0) { @@ -1811,6 +1818,10 @@ void DomainServer::nodeAdded(SharedNodePointer node) { } void DomainServer::nodeKilled(SharedNodePointer node) { + + // remove this node from the connecting / connected ICE lists (if they exist) + _connectingICEPeers.remove(node->getUUID()); + _connectedICEPeers.remove(node->getUUID()); DomainServerNodeData* nodeData = reinterpret_cast(node->getLinkedData());