mirror of
https://github.com/lubosz/overte.git
synced 2025-04-29 20:43:12 +02:00
don't allow domain check-ins while shutting down
This commit is contained in:
parent
d932ba74fd
commit
ea38c4cc49
3 changed files with 9 additions and 1 deletions
|
@ -836,8 +836,9 @@ void Application::cleanupBeforeQuit() {
|
||||||
|
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
auto nodeList = DependencyManager::get<NodeList>();
|
||||||
|
|
||||||
// send the domain a disconnect packet, force a clear of the IP so we can't
|
// send the domain a disconnect packet, force stoppage of domain-server check-ins
|
||||||
nodeList->getDomainHandler().disconnect();
|
nodeList->getDomainHandler().disconnect();
|
||||||
|
nodeList->setIsShuttingDown(true);
|
||||||
|
|
||||||
// tell the packet receiver we're shutting down, so it can drop packets
|
// tell the packet receiver we're shutting down, so it can drop packets
|
||||||
nodeList->getPacketReceiver().setShouldDropPackets(true);
|
nodeList->getPacketReceiver().setShouldDropPackets(true);
|
||||||
|
|
|
@ -219,6 +219,10 @@ void NodeList::addSetOfNodeTypesToNodeInterestSet(const NodeSet& setOfNodeTypes)
|
||||||
}
|
}
|
||||||
|
|
||||||
void NodeList::sendDomainServerCheckIn() {
|
void NodeList::sendDomainServerCheckIn() {
|
||||||
|
if (_isShuttingDown) {
|
||||||
|
qCDebug(networking) << "Refusing to send a domain-server check in while shutting down.";
|
||||||
|
}
|
||||||
|
|
||||||
if (_publicSockAddr.isNull()) {
|
if (_publicSockAddr.isNull()) {
|
||||||
// we don't know our public socket and we need to send it to the domain server
|
// we don't know our public socket and we need to send it to the domain server
|
||||||
qCDebug(networking) << "Waiting for inital public socket from STUN. Will not send domain-server check in.";
|
qCDebug(networking) << "Waiting for inital public socket from STUN. Will not send domain-server check in.";
|
||||||
|
|
|
@ -67,6 +67,8 @@ public:
|
||||||
void setAssignmentServerSocket(const HifiSockAddr& serverSocket) { _assignmentServerSocket = serverSocket; }
|
void setAssignmentServerSocket(const HifiSockAddr& serverSocket) { _assignmentServerSocket = serverSocket; }
|
||||||
void sendAssignment(Assignment& assignment);
|
void sendAssignment(Assignment& assignment);
|
||||||
|
|
||||||
|
void setIsShuttingDown(bool isShuttingDown) { _isShuttingDown = isShuttingDown; }
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void reset();
|
void reset();
|
||||||
void sendDomainServerCheckIn();
|
void sendDomainServerCheckIn();
|
||||||
|
@ -115,6 +117,7 @@ private:
|
||||||
DomainHandler _domainHandler;
|
DomainHandler _domainHandler;
|
||||||
int _numNoReplyDomainCheckIns;
|
int _numNoReplyDomainCheckIns;
|
||||||
HifiSockAddr _assignmentServerSocket;
|
HifiSockAddr _assignmentServerSocket;
|
||||||
|
bool _isShuttingDown { false };
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_NodeList_h
|
#endif // hifi_NodeList_h
|
||||||
|
|
Loading…
Reference in a new issue