don't allow domain check-ins while shutting down

This commit is contained in:
Stephen Birarda 2015-11-12 18:04:15 -08:00
parent d932ba74fd
commit ea38c4cc49
3 changed files with 9 additions and 1 deletions

View file

@ -836,8 +836,9 @@ void Application::cleanupBeforeQuit() {
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->setIsShuttingDown(true);
// tell the packet receiver we're shutting down, so it can drop packets
nodeList->getPacketReceiver().setShouldDropPackets(true);

View file

@ -219,6 +219,10 @@ void NodeList::addSetOfNodeTypesToNodeInterestSet(const NodeSet& setOfNodeTypes)
}
void NodeList::sendDomainServerCheckIn() {
if (_isShuttingDown) {
qCDebug(networking) << "Refusing to send a domain-server check in while shutting down.";
}
if (_publicSockAddr.isNull()) {
// 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.";

View file

@ -66,6 +66,8 @@ public:
void setAssignmentServerSocket(const HifiSockAddr& serverSocket) { _assignmentServerSocket = serverSocket; }
void sendAssignment(Assignment& assignment);
void setIsShuttingDown(bool isShuttingDown) { _isShuttingDown = isShuttingDown; }
public slots:
void reset();
@ -115,6 +117,7 @@ private:
DomainHandler _domainHandler;
int _numNoReplyDomainCheckIns;
HifiSockAddr _assignmentServerSocket;
bool _isShuttingDown { false };
};
#endif // hifi_NodeList_h