mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 23:40:11 +02:00
Merge pull request #3536 from birarda/domain-tunnel
notify data-server about auto networking change to full
This commit is contained in:
commit
36b2028884
2 changed files with 13 additions and 6 deletions
|
@ -359,6 +359,9 @@ void DomainServer::setupAutomaticNetworking() {
|
||||||
|
|
||||||
// call our sendHeartbeaToIceServer immediately anytime a public address changes
|
// call our sendHeartbeaToIceServer immediately anytime a public address changes
|
||||||
connect(nodeList, &LimitedNodeList::publicSockAddrChanged, this, &DomainServer::sendHearbeatToIceServer);
|
connect(nodeList, &LimitedNodeList::publicSockAddrChanged, this, &DomainServer::sendHearbeatToIceServer);
|
||||||
|
|
||||||
|
// tell the data server which type of automatic networking we are using
|
||||||
|
updateNetworkingInfoWithDataServer(automaticNetworkValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
// attempt to update our sockets now
|
// attempt to update our sockets now
|
||||||
|
@ -999,7 +1002,6 @@ void DomainServer::updateNetworkingInfoWithDataServer(const QString& newSetting,
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo: have data-web respond with ice-server hostname to use
|
// todo: have data-web respond with ice-server hostname to use
|
||||||
const HifiSockAddr ICE_SERVER_SOCK_ADDR = HifiSockAddr("ice.highfidelity.io", ICE_SERVER_DEFAULT_PORT);
|
|
||||||
|
|
||||||
void DomainServer::performICEUpdates() {
|
void DomainServer::performICEUpdates() {
|
||||||
sendHearbeatToIceServer();
|
sendHearbeatToIceServer();
|
||||||
|
@ -1007,6 +1009,7 @@ void DomainServer::performICEUpdates() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void DomainServer::sendHearbeatToIceServer() {
|
void DomainServer::sendHearbeatToIceServer() {
|
||||||
|
const HifiSockAddr ICE_SERVER_SOCK_ADDR = HifiSockAddr("ice.highfidelity.io", ICE_SERVER_DEFAULT_PORT);
|
||||||
LimitedNodeList::getInstance()->sendHeartbeatToIceServer(ICE_SERVER_SOCK_ADDR);
|
LimitedNodeList::getInstance()->sendHeartbeatToIceServer(ICE_SERVER_SOCK_ADDR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1024,7 +1027,7 @@ void DomainServer::sendICEPingPackets() {
|
||||||
} else {
|
} else {
|
||||||
// send ping packets to this peer's interfaces
|
// send ping packets to this peer's interfaces
|
||||||
qDebug() << "Sending ping packets to establish connectivity with ICE peer with ID"
|
qDebug() << "Sending ping packets to establish connectivity with ICE peer with ID"
|
||||||
<< peer->getUUID();
|
<< peer->getUUID();
|
||||||
|
|
||||||
// send the ping packet to the local and public sockets for this node
|
// send the ping packet to the local and public sockets for this node
|
||||||
QByteArray localPingPacket = nodeList->constructPingPacket(PingType::Local, false);
|
QByteArray localPingPacket = nodeList->constructPingPacket(PingType::Local, false);
|
||||||
|
@ -1052,11 +1055,13 @@ void DomainServer::processICEHeartbeatResponse(const QByteArray& packet) {
|
||||||
while (!iceResponseStream.atEnd()) {
|
while (!iceResponseStream.atEnd()) {
|
||||||
iceResponseStream >> receivedPeer;
|
iceResponseStream >> receivedPeer;
|
||||||
|
|
||||||
if (!_connectingICEPeers.contains(receivedPeer.getUUID()) && !_connectedICEPeers.contains(receivedPeer.getUUID())) {
|
if (!_connectedICEPeers.contains(receivedPeer.getUUID())) {
|
||||||
qDebug() << "New peer requesting connection being added to hash -" << receivedPeer;
|
if (!_connectingICEPeers.contains(receivedPeer.getUUID())) {
|
||||||
|
qDebug() << "New peer requesting connection being added to hash -" << receivedPeer;
|
||||||
|
}
|
||||||
|
|
||||||
|
_connectingICEPeers[receivedPeer.getUUID()] = receivedPeer;
|
||||||
}
|
}
|
||||||
|
|
||||||
_connectingICEPeers[receivedPeer.getUUID()] = receivedPeer;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,7 @@ NetworkPeer::NetworkPeer(const NetworkPeer& otherPeer) {
|
||||||
|
|
||||||
_wakeTimestamp = otherPeer._wakeTimestamp;
|
_wakeTimestamp = otherPeer._wakeTimestamp;
|
||||||
_lastHeardMicrostamp = otherPeer._lastHeardMicrostamp;
|
_lastHeardMicrostamp = otherPeer._lastHeardMicrostamp;
|
||||||
|
_connectionAttempts = otherPeer._connectionAttempts;
|
||||||
}
|
}
|
||||||
|
|
||||||
NetworkPeer& NetworkPeer::operator=(const NetworkPeer& otherPeer) {
|
NetworkPeer& NetworkPeer::operator=(const NetworkPeer& otherPeer) {
|
||||||
|
@ -62,6 +63,7 @@ void NetworkPeer::swap(NetworkPeer& otherPeer) {
|
||||||
swap(_localSocket, otherPeer._localSocket);
|
swap(_localSocket, otherPeer._localSocket);
|
||||||
swap(_wakeTimestamp, otherPeer._wakeTimestamp);
|
swap(_wakeTimestamp, otherPeer._wakeTimestamp);
|
||||||
swap(_lastHeardMicrostamp, otherPeer._lastHeardMicrostamp);
|
swap(_lastHeardMicrostamp, otherPeer._lastHeardMicrostamp);
|
||||||
|
swap(_connectionAttempts, otherPeer._connectionAttempts);
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray NetworkPeer::toByteArray() const {
|
QByteArray NetworkPeer::toByteArray() const {
|
||||||
|
|
Loading…
Reference in a new issue