fix send of existing peer to querier

This commit is contained in:
Stephen Birarda 2015-05-28 14:37:16 -07:00
parent e096cbe040
commit da0c9fbc31
3 changed files with 14 additions and 11 deletions

View file

@ -82,7 +82,7 @@ void IceServer::processDatagrams() {
if (matchingPeer) {
// we have the peer they want to connect to - send them pack the information for that peer
sendPeerInformationPacket(matchingPeer.data(), &sendingSockAddr);
sendPeerInformationPacket(*(matchingPeer.data()), &sendingSockAddr);
// we also need to send them to the active peer they are hoping to connect to
// create a dummy peer object we can pass to sendPeerInformationPacket
@ -118,8 +118,6 @@ SharedNetworkPeer IceServer::addOrUpdateHeartbeatingPeer(const QByteArray& incom
// we already had the peer so just potentially update their sockets
matchingPeer->setPublicSocket(publicSocket);
matchingPeer->setLocalSocket(localSocket);
qDebug() << "Matched hearbeat to existing network peer" << *matchingPeer;
}
// update our last heard microstamp for this network peer to now

View file

@ -840,7 +840,7 @@ void LimitedNodeList::sendPacketToIceServer(PacketType packetType, const HifiSoc
<< uuidStringWithoutCurlyBraces(peerID);
}
writeUnverifiedDatagram(iceRequestByteArray, iceServerSockAddr);
writeUnverifiedDatagram(iceRequestByteArray, HifiSockAddr("127.0.0.1", ICE_SERVER_DEFAULT_PORT));
}
void LimitedNodeList::putLocalPortIntoSharedMemory(const QString key, QObject* parent, quint16 localPort) {

View file

@ -145,18 +145,24 @@ void NetworkPeer::setActiveSocket(HifiSockAddr* discoveredSocket) {
}
void NetworkPeer::activateLocalSocket() {
qCDebug(networking) << "Activating local socket for network peer with ID" << uuidStringWithoutCurlyBraces(_uuid);
setActiveSocket(&_localSocket);
if (_activeSocket != &_localSocket) {
qCDebug(networking) << "Activating local socket for network peer with ID" << uuidStringWithoutCurlyBraces(_uuid);
setActiveSocket(&_localSocket);
}
}
void NetworkPeer::activatePublicSocket() {
qCDebug(networking) << "Activating public socket for network peer with ID" << uuidStringWithoutCurlyBraces(_uuid);
setActiveSocket(&_publicSocket);
if (_activeSocket != &_publicSocket) {
qCDebug(networking) << "Activating public socket for network peer with ID" << uuidStringWithoutCurlyBraces(_uuid);
setActiveSocket(&_publicSocket);
}
}
void NetworkPeer::activateSymmetricSocket() {
qCDebug(networking) << "Activating symmetric socket for network peer with ID" << uuidStringWithoutCurlyBraces(_uuid);
setActiveSocket(&_symmetricSocket);
if (_activeSocket != &_symmetricSocket) {
qCDebug(networking) << "Activating symmetric socket for network peer with ID" << uuidStringWithoutCurlyBraces(_uuid);
setActiveSocket(&_symmetricSocket);
}
}
void NetworkPeer::activateMatchingOrNewSymmetricSocket(const HifiSockAddr& matchableSockAddr) {
@ -182,7 +188,6 @@ void NetworkPeer::softReset() {
_connectionAttempts = 0;
}
QByteArray NetworkPeer::toByteArray() const {
QByteArray peerByteArray;