From b4ef3dbd8add910d3c942ef7703998504410e548 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 17 Oct 2013 16:56:52 -0700 Subject: [PATCH 01/11] add ping/reply to assignment-client servers --- assignment-client/src/audio/AudioMixer.cpp | 47 ++++++------- assignment-client/src/avatars/AvatarMixer.cpp | 14 +++- libraries/shared/src/NodeList.cpp | 66 ++++++++++++------- libraries/shared/src/NodeList.h | 6 +- .../voxel-server-library/src/VoxelServer.cpp | 29 ++++---- 5 files changed, 88 insertions(+), 74 deletions(-) diff --git a/assignment-client/src/audio/AudioMixer.cpp b/assignment-client/src/audio/AudioMixer.cpp index 1b44c2e905..31de1b6317 100644 --- a/assignment-client/src/audio/AudioMixer.cpp +++ b/assignment-client/src/audio/AudioMixer.cpp @@ -81,6 +81,9 @@ void AudioMixer::run() { NodeList *nodeList = NodeList::getInstance(); nodeList->setOwnerType(NODE_TYPE_AUDIO_MIXER); + const char AUDIO_MIXER_NODE_TYPES_OF_INTEREST[2] = { NODE_TYPE_AGENT, NODE_TYPE_AUDIO_INJECTOR }; + nodeList->setNodeTypesOfInterest(AUDIO_MIXER_NODE_TYPES_OF_INTEREST, sizeof(AUDIO_MIXER_NODE_TYPES_OF_INTEREST)); + ssize_t receivedBytes = 0; nodeList->linkedDataCreateCallback = attachNewBufferToNode; @@ -144,6 +147,9 @@ void AudioMixer::run() { } } + // get the NodeList to ping any inactive nodes, for hole punching + nodeList->possiblyPingInactiveNodes(); + for (NodeList::iterator node = nodeList->begin(); node != nodeList->end(); node++) { PositionalAudioRingBuffer* positionalRingBuffer = (PositionalAudioRingBuffer*) node->getLinkedData(); if (positionalRingBuffer && positionalRingBuffer->shouldBeAddedToMix(JITTER_BUFFER_SAMPLES)) { @@ -353,39 +359,24 @@ void AudioMixer::run() { // pull any new audio data from nodes off of the network stack while (nodeList->getNodeSocket()->receive(nodeAddress, packetData, &receivedBytes) && packetVersionMatch(packetData)) { - if (packetData[0] == PACKET_TYPE_MICROPHONE_AUDIO_NO_ECHO || - packetData[0] == PACKET_TYPE_MICROPHONE_AUDIO_WITH_ECHO) { + if (packetData[0] == PACKET_TYPE_MICROPHONE_AUDIO_NO_ECHO + || packetData[0] == PACKET_TYPE_MICROPHONE_AUDIO_WITH_ECHO + || packetData[0] == PACKET_TYPE_INJECT_AUDIO) { - unsigned char* currentBuffer = packetData + numBytesForPacketHeader(packetData); - QUuid nodeUUID = QUuid::fromRfc4122(QByteArray((char*) currentBuffer, NUM_BYTES_RFC4122_UUID)); - - Node* avatarNode = nodeList->addOrUpdateNode(nodeUUID, - NODE_TYPE_AGENT, - nodeAddress, - nodeAddress); - - // temp activation of public socket before server ping/reply is setup - if (!avatarNode->getActiveSocket()) { - avatarNode->activatePublicSocket(); - } - - nodeList->updateNodeWithData(nodeAddress, packetData, receivedBytes); - - if (std::isnan(((PositionalAudioRingBuffer *)avatarNode->getLinkedData())->getOrientation().x)) { - // kill off this node - temporary solution to mixer crash on mac sleep - avatarNode->setAlive(false); - } - } else if (packetData[0] == PACKET_TYPE_INJECT_AUDIO) { QUuid nodeUUID = QUuid::fromRfc4122(QByteArray((char*) packetData + numBytesForPacketHeader(packetData), NUM_BYTES_RFC4122_UUID)); - Node* matchingInjector = nodeList->addOrUpdateNode(nodeUUID, - NODE_TYPE_AUDIO_INJECTOR, - NULL, - NULL); + Node* matchingNode = nodeList->nodeWithUUID(nodeUUID); - // give the new audio data to the matching injector node - nodeList->updateNodeWithData(matchingInjector, packetData, receivedBytes); + if (matchingNode) { + nodeList->updateNodeWithData(matchingNode, nodeAddress, packetData, receivedBytes); + + if (packetData[0] != PACKET_TYPE_INJECT_AUDIO + && std::isnan(((PositionalAudioRingBuffer *)matchingNode->getLinkedData())->getOrientation().x)) { + // kill off this node - temporary solution to mixer crash on mac sleep + matchingNode->setAlive(false); + } + } } else { // let processNodeData handle it. nodeList->processNodeData(nodeAddress, packetData, receivedBytes); diff --git a/assignment-client/src/avatars/AvatarMixer.cpp b/assignment-client/src/avatars/AvatarMixer.cpp index b515f1400c..4e58f0b014 100644 --- a/assignment-client/src/avatars/AvatarMixer.cpp +++ b/assignment-client/src/avatars/AvatarMixer.cpp @@ -97,6 +97,8 @@ void AvatarMixer::run() { NodeList* nodeList = NodeList::getInstance(); nodeList->setOwnerType(NODE_TYPE_AVATAR_MIXER); + nodeList->setNodeTypesOfInterest(&NODE_TYPE_AGENT, 1); + nodeList->linkedDataCreateCallback = attachAvatarDataToNode; nodeList->startSilentNodeRemovalThread(); @@ -123,6 +125,8 @@ void AvatarMixer::run() { NodeList::getInstance()->sendDomainServerCheckIn(); } + nodeList->possiblyPingInactiveNodes(); + if (nodeList->getNodeSocket()->receive(&nodeAddress, packetData, &receivedBytes) && packetVersionMatch(packetData)) { switch (packetData[0]) { @@ -131,10 +135,14 @@ void AvatarMixer::run() { NUM_BYTES_RFC4122_UUID)); // add or update the node in our list - avatarNode = nodeList->addOrUpdateNode(nodeUUID, NODE_TYPE_AGENT, &nodeAddress, &nodeAddress); + avatarNode = nodeList->nodeWithUUID(nodeUUID); - // parse positional data from an node - nodeList->updateNodeWithData(avatarNode, packetData, receivedBytes); + if (avatarNode) { + // parse positional data from an node + nodeList->updateNodeWithData(avatarNode, &nodeAddress, packetData, receivedBytes); + } else { + break; + } case PACKET_TYPE_INJECT_AUDIO: broadcastAvatarData(nodeList, nodeUUID, &nodeAddress); break; diff --git a/libraries/shared/src/NodeList.cpp b/libraries/shared/src/NodeList.cpp index 6510276f9a..d0520e00ba 100644 --- a/libraries/shared/src/NodeList.cpp +++ b/libraries/shared/src/NodeList.cpp @@ -151,7 +151,7 @@ void NodeList::processNodeData(sockaddr* senderAddress, unsigned char* packetDat } case PACKET_TYPE_PING_REPLY: { // activate the appropriate socket for this node, if not yet updated - activateSocketFromPingReply(senderAddress); + activateSocketFromNodeCommunication(senderAddress); // set the ping time for this node for stat collection timePingReply(senderAddress, packetData); @@ -199,6 +199,7 @@ void NodeList::processBulkNodeData(sockaddr *senderAddress, unsigned char *packe } currentPosition += updateNodeWithData(matchingNode, + NULL, packetHolder, numTotalBytes - (currentPosition - startPosition)); @@ -206,35 +207,32 @@ void NodeList::processBulkNodeData(sockaddr *senderAddress, unsigned char *packe } } -int NodeList::updateNodeWithData(sockaddr *senderAddress, unsigned char *packetData, size_t dataBytes) { - // find the node by the sockaddr - Node* matchingNode = nodeWithAddress(senderAddress); - - if (matchingNode) { - return updateNodeWithData(matchingNode, packetData, dataBytes); - } else { - return 0; - } -} - -int NodeList::updateNodeWithData(Node *node, unsigned char *packetData, int dataBytes) { +int NodeList::updateNodeWithData(Node *node, sockaddr* senderAddress, unsigned char *packetData, int dataBytes) { node->lock(); node->setLastHeardMicrostamp(usecTimestampNow()); - if (node->getActiveSocket()) { + if (senderAddress) { + activateSocketFromNodeCommunication(senderAddress); + } + + if (node->getActiveSocket() || !senderAddress) { node->recordBytesReceived(dataBytes); + + if (!node->getLinkedData() && linkedDataCreateCallback) { + linkedDataCreateCallback(node); + } + + int numParsedBytes = node->getLinkedData()->parseData(packetData, dataBytes); + + node->unlock(); + + return numParsedBytes; + } else { + // we weren't able to match the sender address to the address we have for this node, unlock and don't parse + node->unlock(); + return 0; } - - if (!node->getLinkedData() && linkedDataCreateCallback) { - linkedDataCreateCallback(node); - } - - int numParsedBytes = node->getLinkedData()->parseData(packetData, dataBytes); - - node->unlock(); - - return numParsedBytes; } Node* NodeList::nodeWithAddress(sockaddr *senderAddress) { @@ -671,7 +669,25 @@ unsigned NodeList::broadcastToNodes(unsigned char* broadcastData, size_t dataByt return n; } -void NodeList::activateSocketFromPingReply(sockaddr *nodeAddress) { +const uint64_t PING_INACTIVE_NODE_INTERVAL_USECS = 1 * 1000 * 1000; + +void NodeList::possiblyPingInactiveNodes() { + static timeval lastPing = {}; + + // make sure PING_INACTIVE_NODE_INTERVAL_USECS has elapsed since last ping + if (usecTimestampNow() - usecTimestamp(&lastPing) >= PING_INACTIVE_NODE_INTERVAL_USECS) { + gettimeofday(&lastPing, NULL); + + for(NodeList::iterator node = begin(); node != end(); node++) { + if (!node->getActiveSocket()) { + // we don't have an active link to this node, ping it to set that up + pingPublicAndLocalSocketsForInactiveNode(&(*node)); + } + } + } +} + +void NodeList::activateSocketFromNodeCommunication(sockaddr *nodeAddress) { for(NodeList::iterator node = begin(); node != end(); node++) { if (!node->getActiveSocket()) { // check both the public and local addresses for each node to see if we find a match diff --git a/libraries/shared/src/NodeList.h b/libraries/shared/src/NodeList.h index ed7f0e637a..f98ae7070c 100644 --- a/libraries/shared/src/NodeList.h +++ b/libraries/shared/src/NodeList.h @@ -117,8 +117,7 @@ public: void processNodeData(sockaddr *senderAddress, unsigned char *packetData, size_t dataBytes); void processBulkNodeData(sockaddr *senderAddress, unsigned char *packetData, int numTotalBytes); - int updateNodeWithData(sockaddr *senderAddress, unsigned char *packetData, size_t dataBytes); - int updateNodeWithData(Node *node, unsigned char *packetData, int dataBytes); + int updateNodeWithData(Node *node, sockaddr* senderAddress, unsigned char *packetData, int dataBytes); unsigned broadcastToNodes(unsigned char *broadcastData, size_t dataBytes, const char* nodeTypes, int numNodeTypes); @@ -140,6 +139,7 @@ public: void addDomainListener(DomainChangeListener* listener); void removeDomainListener(DomainChangeListener* listener); + void possiblyPingInactiveNodes(); private: static NodeList* _sharedInstance; @@ -172,7 +172,7 @@ private: uint16_t _publicPort; bool _shouldUseDomainServerAsSTUN; - void activateSocketFromPingReply(sockaddr *nodeAddress); + void activateSocketFromNodeCommunication(sockaddr *nodeAddress); void timePingReply(sockaddr *nodeAddress, unsigned char *packetData); std::vector _hooks; diff --git a/libraries/voxel-server-library/src/VoxelServer.cpp b/libraries/voxel-server-library/src/VoxelServer.cpp index a24f13854b..188a2c7e05 100644 --- a/libraries/voxel-server-library/src/VoxelServer.cpp +++ b/libraries/voxel-server-library/src/VoxelServer.cpp @@ -327,6 +327,9 @@ void VoxelServer::run() { NodeList* nodeList = NodeList::getInstance(); nodeList->setOwnerType(NODE_TYPE_VOXEL_SERVER); + // we need to ask the DS about agents so we can ping/reply with them + nodeList->setNodeTypesOfInterest(&NODE_TYPE_AGENT, 1); + setvbuf(stdout, NULL, _IOLBF, 0); // tell our NodeList about our desire to get notifications @@ -434,6 +437,9 @@ void VoxelServer::run() { NodeList::getInstance()->sendDomainServerCheckIn(); } + // ping our inactive nodes to punch holes with them + nodeList->possiblyPingInactiveNodes(); + if (nodeList->getNodeSocket()->receive(&senderAddress, packetData, &packetLength) && packetVersionMatch(packetData)) { @@ -445,23 +451,16 @@ void VoxelServer::run() { QUuid nodeUUID = QUuid::fromRfc4122(QByteArray((char*)packetData + numBytesPacketHeader, NUM_BYTES_RFC4122_UUID)); - Node* node = NodeList::getInstance()->addOrUpdateNode(nodeUUID, - NODE_TYPE_AGENT, - &senderAddress, - &senderAddress); + Node* node = nodeList->nodeWithUUID(nodeUUID); - // temp activation of public socket before server ping/reply is setup - if (!node->getActiveSocket()) { - node->activatePublicSocket(); + if (node) { + NodeList::getInstance()->updateNodeWithData(node, &senderAddress, packetData, packetLength); + + VoxelNodeData* nodeData = (VoxelNodeData*) node->getLinkedData(); + if (nodeData && !nodeData->isVoxelSendThreadInitalized()) { + nodeData->initializeVoxelSendThread(this); + } } - - NodeList::getInstance()->updateNodeWithData(node, packetData, packetLength); - - VoxelNodeData* nodeData = (VoxelNodeData*) node->getLinkedData(); - if (nodeData && !nodeData->isVoxelSendThreadInitalized()) { - nodeData->initializeVoxelSendThread(this); - } - } else if (packetData[0] == PACKET_TYPE_PING || packetData[0] == PACKET_TYPE_DOMAIN || packetData[0] == PACKET_TYPE_STUN_RESPONSE) { From 14e258c35749d3da87dfa4eb3bf8fef8f12d8f8d Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 17 Oct 2013 16:57:59 -0700 Subject: [PATCH 02/11] don't send audio to nodes who don't have an active socket --- assignment-client/src/audio/AudioMixer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assignment-client/src/audio/AudioMixer.cpp b/assignment-client/src/audio/AudioMixer.cpp index 31de1b6317..1ae67c4063 100644 --- a/assignment-client/src/audio/AudioMixer.cpp +++ b/assignment-client/src/audio/AudioMixer.cpp @@ -163,7 +163,7 @@ void AudioMixer::run() { const int PHASE_DELAY_AT_90 = 20; - if (node->getType() == NODE_TYPE_AGENT) { + if (node->getType() == NODE_TYPE_AGENT && node->getActiveSocket()) { AvatarAudioRingBuffer* nodeRingBuffer = (AvatarAudioRingBuffer*) node->getLinkedData(); // zero out the client mix for this node From bd806241fdf4c6ad94f3b11f84dcf15affcefbd0 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 17 Oct 2013 17:01:15 -0700 Subject: [PATCH 03/11] don't attempt to send in UDPSocket with NULL destAddress --- libraries/shared/src/UDPSocket.cpp | 22 ++++++++++++------- .../voxel-server-library/src/VoxelServer.cpp | 2 +- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/libraries/shared/src/UDPSocket.cpp b/libraries/shared/src/UDPSocket.cpp index 73849847e4..1318fbc4a5 100644 --- a/libraries/shared/src/UDPSocket.cpp +++ b/libraries/shared/src/UDPSocket.cpp @@ -265,16 +265,22 @@ bool UDPSocket::receive(sockaddr* recvAddress, void* receivedData, ssize_t* rece } int UDPSocket::send(sockaddr* destAddress, const void* data, size_t byteLength) const { - // send data via UDP - int sent_bytes = sendto(handle, (const char*)data, byteLength, - 0, (sockaddr *) destAddress, sizeof(sockaddr_in)); - - if (sent_bytes != byteLength) { - qDebug("Failed to send packet: %s\n", strerror(errno)); - return false; + if (destAddress) { + // send data via UDP + int sent_bytes = sendto(handle, (const char*)data, byteLength, + 0, (sockaddr *) destAddress, sizeof(sockaddr_in)); + + if (sent_bytes != byteLength) { + qDebug("Failed to send packet: %s\n", strerror(errno)); + return false; + } + + return sent_bytes; + } else { + qDebug("UDPSocket send called with NULL destination address - Likely a node with no active socket.\n"); + return 0; } - return sent_bytes; } int UDPSocket::send(const char* destAddress, int destPort, const void* data, size_t byteLength) const { diff --git a/libraries/voxel-server-library/src/VoxelServer.cpp b/libraries/voxel-server-library/src/VoxelServer.cpp index 188a2c7e05..3bacfd8462 100644 --- a/libraries/voxel-server-library/src/VoxelServer.cpp +++ b/libraries/voxel-server-library/src/VoxelServer.cpp @@ -454,7 +454,7 @@ void VoxelServer::run() { Node* node = nodeList->nodeWithUUID(nodeUUID); if (node) { - NodeList::getInstance()->updateNodeWithData(node, &senderAddress, packetData, packetLength); + nodeList->updateNodeWithData(node, &senderAddress, packetData, packetLength); VoxelNodeData* nodeData = (VoxelNodeData*) node->getLinkedData(); if (nodeData && !nodeData->isVoxelSendThreadInitalized()) { From 19e6f668d2af9374623eaa196924adda264c9a97 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 17 Oct 2013 17:25:14 -0700 Subject: [PATCH 04/11] add debug to test hole punching --- libraries/shared/src/NodeList.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/shared/src/NodeList.cpp b/libraries/shared/src/NodeList.cpp index d0520e00ba..606e390f9d 100644 --- a/libraries/shared/src/NodeList.cpp +++ b/libraries/shared/src/NodeList.cpp @@ -680,6 +680,7 @@ void NodeList::possiblyPingInactiveNodes() { for(NodeList::iterator node = begin(); node != end(); node++) { if (!node->getActiveSocket()) { + qDebug() << "Attempting to ping node" << *node << "\n"; // we don't have an active link to this node, ping it to set that up pingPublicAndLocalSocketsForInactiveNode(&(*node)); } From b25487cda3bf7d37191f684f3ac66a39a282f2bb Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 17 Oct 2013 17:33:34 -0700 Subject: [PATCH 05/11] increase the ping interval --- libraries/shared/src/NodeList.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/shared/src/NodeList.cpp b/libraries/shared/src/NodeList.cpp index 678a1843fc..0c58db44be 100644 --- a/libraries/shared/src/NodeList.cpp +++ b/libraries/shared/src/NodeList.cpp @@ -670,7 +670,7 @@ unsigned NodeList::broadcastToNodes(unsigned char* broadcastData, size_t dataByt return n; } -const uint64_t PING_INACTIVE_NODE_INTERVAL_USECS = 1 * 1000 * 1000; +const uint64_t PING_INACTIVE_NODE_INTERVAL_USECS = 0.25 * 1000 * 1000; void NodeList::possiblyPingInactiveNodes() { static timeval lastPing = {}; From a4798acb223699372cadd5bfc4e65198b1cb8f77 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 17 Oct 2013 17:35:24 -0700 Subject: [PATCH 06/11] bring ping interval back to 1 second --- libraries/shared/src/NodeList.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/shared/src/NodeList.cpp b/libraries/shared/src/NodeList.cpp index 0c58db44be..678a1843fc 100644 --- a/libraries/shared/src/NodeList.cpp +++ b/libraries/shared/src/NodeList.cpp @@ -670,7 +670,7 @@ unsigned NodeList::broadcastToNodes(unsigned char* broadcastData, size_t dataByt return n; } -const uint64_t PING_INACTIVE_NODE_INTERVAL_USECS = 0.25 * 1000 * 1000; +const uint64_t PING_INACTIVE_NODE_INTERVAL_USECS = 1 * 1000 * 1000; void NodeList::possiblyPingInactiveNodes() { static timeval lastPing = {}; From ce934b0684a12629448c089151291edffa039969 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 17 Oct 2013 17:43:44 -0700 Subject: [PATCH 07/11] add packet receive debug --- assignment-client/src/audio/AudioMixer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/assignment-client/src/audio/AudioMixer.cpp b/assignment-client/src/audio/AudioMixer.cpp index 1ae67c4063..21461634e5 100644 --- a/assignment-client/src/audio/AudioMixer.cpp +++ b/assignment-client/src/audio/AudioMixer.cpp @@ -359,6 +359,7 @@ void AudioMixer::run() { // pull any new audio data from nodes off of the network stack while (nodeList->getNodeSocket()->receive(nodeAddress, packetData, &receivedBytes) && packetVersionMatch(packetData)) { + qDebug() << "Received a packet with header" << packetData[0] << "\n"; if (packetData[0] == PACKET_TYPE_MICROPHONE_AUDIO_NO_ECHO || packetData[0] == PACKET_TYPE_MICROPHONE_AUDIO_WITH_ECHO || packetData[0] == PACKET_TYPE_INJECT_AUDIO) { From 79451f974a2293628e46ccc1e24802a439209c4e Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 17 Oct 2013 17:44:32 -0700 Subject: [PATCH 08/11] add debug to AvatarMixer, not AudioMixer --- assignment-client/src/audio/AudioMixer.cpp | 1 - assignment-client/src/avatars/AvatarMixer.cpp | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/assignment-client/src/audio/AudioMixer.cpp b/assignment-client/src/audio/AudioMixer.cpp index 21461634e5..1ae67c4063 100644 --- a/assignment-client/src/audio/AudioMixer.cpp +++ b/assignment-client/src/audio/AudioMixer.cpp @@ -359,7 +359,6 @@ void AudioMixer::run() { // pull any new audio data from nodes off of the network stack while (nodeList->getNodeSocket()->receive(nodeAddress, packetData, &receivedBytes) && packetVersionMatch(packetData)) { - qDebug() << "Received a packet with header" << packetData[0] << "\n"; if (packetData[0] == PACKET_TYPE_MICROPHONE_AUDIO_NO_ECHO || packetData[0] == PACKET_TYPE_MICROPHONE_AUDIO_WITH_ECHO || packetData[0] == PACKET_TYPE_INJECT_AUDIO) { diff --git a/assignment-client/src/avatars/AvatarMixer.cpp b/assignment-client/src/avatars/AvatarMixer.cpp index 4e58f0b014..b7720cee04 100644 --- a/assignment-client/src/avatars/AvatarMixer.cpp +++ b/assignment-client/src/avatars/AvatarMixer.cpp @@ -129,6 +129,7 @@ void AvatarMixer::run() { if (nodeList->getNodeSocket()->receive(&nodeAddress, packetData, &receivedBytes) && packetVersionMatch(packetData)) { + qDebug() << "Received a packet with header" << packetData[0] << "\n"; switch (packetData[0]) { case PACKET_TYPE_HEAD_DATA: nodeUUID = QUuid::fromRfc4122(QByteArray((char*) packetData + numBytesForPacketHeader(packetData), From ded77355729301214c631e4d7180398cedd38f37 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 17 Oct 2013 17:54:25 -0700 Subject: [PATCH 09/11] remove crazy debug from testing --- assignment-client/src/avatars/AvatarMixer.cpp | 1 - interface/src/Application.cpp | 1 + libraries/shared/src/NodeList.cpp | 4 +--- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/assignment-client/src/avatars/AvatarMixer.cpp b/assignment-client/src/avatars/AvatarMixer.cpp index b7720cee04..4e58f0b014 100644 --- a/assignment-client/src/avatars/AvatarMixer.cpp +++ b/assignment-client/src/avatars/AvatarMixer.cpp @@ -129,7 +129,6 @@ void AvatarMixer::run() { if (nodeList->getNodeSocket()->receive(&nodeAddress, packetData, &receivedBytes) && packetVersionMatch(packetData)) { - qDebug() << "Received a packet with header" << packetData[0] << "\n"; switch (packetData[0]) { case PACKET_TYPE_HEAD_DATA: nodeUUID = QUuid::fromRfc4122(QByteArray((char*) packetData + numBytesForPacketHeader(packetData), diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 8f08b75a93..635e6d9e98 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3696,6 +3696,7 @@ void* Application::networkReceive(void* args) { app->_bytesCount += bytesReceived; if (packetVersionMatch(app->_incomingPacket)) { + qDebug() << "Received a packet with header" << app->_incomingPacket[0] << "\n"; // only process this packet if we have a match on the packet version switch (app->_incomingPacket[0]) { case PACKET_TYPE_TRANSMITTER_DATA_V2: diff --git a/libraries/shared/src/NodeList.cpp b/libraries/shared/src/NodeList.cpp index 678a1843fc..5b25a3dde1 100644 --- a/libraries/shared/src/NodeList.cpp +++ b/libraries/shared/src/NodeList.cpp @@ -599,7 +599,6 @@ void NodeList::pingPublicAndLocalSocketsForInactiveNode(Node* node) const { currentTime = usecTimestampNow(); memcpy(pingPacket + numHeaderBytes, ¤tTime, sizeof(currentTime)); - qDebug() << "Attemping to ping" << *node << "\n"; // send the ping packet to the local and public sockets for this node _nodeSocket.send(node->getLocalSocket(), pingPacket, sizeof(pingPacket)); _nodeSocket.send(node->getPublicSocket(), pingPacket, sizeof(pingPacket)); @@ -680,8 +679,7 @@ void NodeList::possiblyPingInactiveNodes() { gettimeofday(&lastPing, NULL); for(NodeList::iterator node = begin(); node != end(); node++) { - if (!node->getActiveSocket()) { - qDebug() << "Attempting to ping node" << *node << "\n"; + if (!node->getActiveSocket()) {g // we don't have an active link to this node, ping it to set that up pingPublicAndLocalSocketsForInactiveNode(&(*node)); } From 11a05481e1ff028b63e2e5f509bf3a3aa0841e7a Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 17 Oct 2013 17:54:52 -0700 Subject: [PATCH 10/11] remove an infamous birarda extra g --- libraries/shared/src/NodeList.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/shared/src/NodeList.cpp b/libraries/shared/src/NodeList.cpp index 5b25a3dde1..e067c7afa9 100644 --- a/libraries/shared/src/NodeList.cpp +++ b/libraries/shared/src/NodeList.cpp @@ -679,7 +679,7 @@ void NodeList::possiblyPingInactiveNodes() { gettimeofday(&lastPing, NULL); for(NodeList::iterator node = begin(); node != end(); node++) { - if (!node->getActiveSocket()) {g + if (!node->getActiveSocket()) { // we don't have an active link to this node, ping it to set that up pingPublicAndLocalSocketsForInactiveNode(&(*node)); } From fad82a48d55abaa3341dc3fc88bd0c135f959370 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 17 Oct 2013 17:56:06 -0700 Subject: [PATCH 11/11] remove the debug in Application.cpp --- interface/src/Application.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 635e6d9e98..8f08b75a93 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3696,7 +3696,6 @@ void* Application::networkReceive(void* args) { app->_bytesCount += bytesReceived; if (packetVersionMatch(app->_incomingPacket)) { - qDebug() << "Received a packet with header" << app->_incomingPacket[0] << "\n"; // only process this packet if we have a match on the packet version switch (app->_incomingPacket[0]) { case PACKET_TYPE_TRANSMITTER_DATA_V2: