mirror of
https://github.com/overte-org/overte.git
synced 2025-08-11 01:23:17 +02:00
Potentially fix STUN IP+Port init for heartbeat issue?
This commit is contained in:
parent
cfc7309c96
commit
97681786cd
3 changed files with 9 additions and 10 deletions
|
@ -901,14 +901,13 @@ void DomainServer::setupAutomaticNetworking() {
|
||||||
qDebug() << "domain-server" << _automaticNetworkingSetting << "automatic networking enabled for ID"
|
qDebug() << "domain-server" << _automaticNetworkingSetting << "automatic networking enabled for ID"
|
||||||
<< uuidStringWithoutCurlyBraces(domainID) << "via" << _oauthProviderURL.toString();
|
<< uuidStringWithoutCurlyBraces(domainID) << "via" << _oauthProviderURL.toString();
|
||||||
|
|
||||||
|
auto nodeList = DependencyManager::get<LimitedNodeList>();
|
||||||
|
|
||||||
|
// send any public socket changes to the data server so nodes can find us at our new IP
|
||||||
|
connect(nodeList.data(), &LimitedNodeList::publicSockAddrChanged, this,
|
||||||
|
&DomainServer::performIPAddressPortUpdate);
|
||||||
|
|
||||||
if (_automaticNetworkingSetting == IP_ONLY_AUTOMATIC_NETWORKING_VALUE) {
|
if (_automaticNetworkingSetting == IP_ONLY_AUTOMATIC_NETWORKING_VALUE) {
|
||||||
|
|
||||||
auto nodeList = DependencyManager::get<LimitedNodeList>();
|
|
||||||
|
|
||||||
// send any public socket changes to the data server so nodes can find us at our new IP
|
|
||||||
connect(nodeList.data(), &LimitedNodeList::publicSockAddrChanged,
|
|
||||||
this, &DomainServer::performIPAddressUpdate);
|
|
||||||
|
|
||||||
// have the LNL enable public socket updating via STUN
|
// have the LNL enable public socket updating via STUN
|
||||||
nodeList->startSTUNPublicSocketUpdate();
|
nodeList->startSTUNPublicSocketUpdate();
|
||||||
}
|
}
|
||||||
|
@ -1506,7 +1505,7 @@ QJsonObject jsonForDomainSocketUpdate(const HifiSockAddr& socket) {
|
||||||
|
|
||||||
const QString DOMAIN_UPDATE_AUTOMATIC_NETWORKING_KEY = "automatic_networking";
|
const QString DOMAIN_UPDATE_AUTOMATIC_NETWORKING_KEY = "automatic_networking";
|
||||||
|
|
||||||
void DomainServer::performIPAddressUpdate(const HifiSockAddr& newPublicSockAddr) {
|
void DomainServer::performIPAddressPortUpdate(const HifiSockAddr& newPublicSockAddr) {
|
||||||
static const QString PUBLIC_SOCKET_ADDRESS_KEY = "network_address";
|
static const QString PUBLIC_SOCKET_ADDRESS_KEY = "network_address";
|
||||||
static const QString PUBLIC_SOCKET_PORT_KEY = "port";
|
static const QString PUBLIC_SOCKET_PORT_KEY = "port";
|
||||||
const QString& publicSocketAddress = newPublicSockAddr.getAddress().toString();
|
const QString& publicSocketAddress = newPublicSockAddr.getAddress().toString();
|
||||||
|
|
|
@ -112,7 +112,7 @@ private slots:
|
||||||
void setupPendingAssignmentCredits();
|
void setupPendingAssignmentCredits();
|
||||||
void sendPendingTransactionsToServer();
|
void sendPendingTransactionsToServer();
|
||||||
|
|
||||||
void performIPAddressUpdate(const HifiSockAddr& newPublicSockAddr);
|
void performIPAddressPortUpdate(const HifiSockAddr& newPublicSockAddr);
|
||||||
void sendHeartbeatToMetaverse() { sendHeartbeatToMetaverse(QString(), int()); }
|
void sendHeartbeatToMetaverse() { sendHeartbeatToMetaverse(QString(), int()); }
|
||||||
void sendHeartbeatToIceServer();
|
void sendHeartbeatToIceServer();
|
||||||
void nodePingMonitor();
|
void nodePingMonitor();
|
||||||
|
|
|
@ -1197,7 +1197,7 @@ void LimitedNodeList::stopInitialSTUNUpdate(bool success) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// We now setup a timer here to fire every so often to check that our IP address has not changed.
|
// We now setup a timer here to fire every so often to check that our IP address has not changed.
|
||||||
// Or, if we failed - if will check if we can eventually get a public socket
|
// Or, if we failed - it will check if we can eventually get a public socket
|
||||||
const int STUN_IP_ADDRESS_CHECK_INTERVAL_MSECS = 10 * 1000;
|
const int STUN_IP_ADDRESS_CHECK_INTERVAL_MSECS = 10 * 1000;
|
||||||
|
|
||||||
QTimer* stunOccasionalTimer = new QTimer { this };
|
QTimer* stunOccasionalTimer = new QTimer { this };
|
||||||
|
|
Loading…
Reference in a new issue