look for connection steps in LimitedNodeList

This commit is contained in:
Stephen Birarda 2015-05-27 15:54:39 -07:00
parent 734798a365
commit e6e2c4b95d
4 changed files with 14 additions and 14 deletions

View file

@ -875,7 +875,7 @@ void AudioClient::handleAudioInput() {
_stats.sentPacket(); _stats.sentPacket();
nodeList->flagTimeForConnectionStep(NodeList::ConnectionStep::SendAudioPacket); nodeList->flagTimeForConnectionStep(LimitedNodeList::ConnectionStep::SendAudioPacket);
int packetBytes = currentPacketPtr - audioDataPacket; int packetBytes = currentPacketPtr - audioDataPacket;
nodeList->writeDatagram(audioDataPacket, packetBytes, audioMixer); nodeList->writeDatagram(audioDataPacket, packetBytes, audioMixer);

View file

@ -106,7 +106,7 @@ bool AddressManager::handleUrl(const QUrl& lookupUrl) {
qCDebug(networking) << "Trying to go to URL" << lookupUrl.toString(); qCDebug(networking) << "Trying to go to URL" << lookupUrl.toString();
DependencyManager::get<NodeList>()->flagTimeForConnectionStep(NodeList::ConnectionStep::LookupAddress); DependencyManager::get<NodeList>()->flagTimeForConnectionStep(LimitedNodeList::ConnectionStep::LookupAddress);
// there are 4 possible lookup strings // there are 4 possible lookup strings
@ -204,7 +204,7 @@ void AddressManager::goToAddressFromObject(const QVariantMap& dataObject, const
const QString DOMAIN_NETWORK_PORT_KEY = "network_port"; const QString DOMAIN_NETWORK_PORT_KEY = "network_port";
const QString DOMAIN_ICE_SERVER_ADDRESS_KEY = "ice_server_address"; const QString DOMAIN_ICE_SERVER_ADDRESS_KEY = "ice_server_address";
DependencyManager::get<NodeList>()->flagTimeForConnectionStep(NodeList::ConnectionStep::HandleAddress); DependencyManager::get<NodeList>()->flagTimeForConnectionStep(LimitedNodeList::ConnectionStep::HandleAddress);
if (domainObject.contains(DOMAIN_NETWORK_ADDRESS_KEY)) { if (domainObject.contains(DOMAIN_NETWORK_ADDRESS_KEY)) {
QString domainHostname = domainObject[DOMAIN_NETWORK_ADDRESS_KEY].toString(); QString domainHostname = domainObject[DOMAIN_NETWORK_ADDRESS_KEY].toString();
@ -436,7 +436,7 @@ void AddressManager::setDomainInfo(const QString& hostname, quint16 port) {
qCDebug(networking) << "Possible domain change required to connect to domain at" << hostname << "on" << port; qCDebug(networking) << "Possible domain change required to connect to domain at" << hostname << "on" << port;
DependencyManager::get<NodeList>()->flagTimeForConnectionStep(NodeList::ConnectionStep::HandleAddress); DependencyManager::get<NodeList>()->flagTimeForConnectionStep(LimitedNodeList::ConnectionStep::HandleAddress);
emit possibleDomainChangeRequired(hostname, port); emit possibleDomainChangeRequired(hostname, port);
} }

View file

@ -85,7 +85,7 @@ void DomainHandler::setSockAddr(const HifiSockAddr& sockAddr, const QString& hos
} }
if (!_sockAddr.isNull()) { if (!_sockAddr.isNull()) {
DependencyManager::get<NodeList>()->flagTimeForConnectionStep(NodeList::ConnectionStep::SetDomainSocket); DependencyManager::get<NodeList>()->flagTimeForConnectionStep(LimitedNodeList::ConnectionStep::SetDomainSocket);
} }
// some callers may pass a hostname, this is not to be used for lookup but for DTLS certificate verification // some callers may pass a hostname, this is not to be used for lookup but for DTLS certificate verification
@ -115,7 +115,7 @@ void DomainHandler::setHostnameAndPort(const QString& hostname, quint16 port) {
qCDebug(networking, "Looking up DS hostname %s.", _hostname.toLocal8Bit().constData()); qCDebug(networking, "Looking up DS hostname %s.", _hostname.toLocal8Bit().constData());
QHostInfo::lookupHost(_hostname, this, SLOT(completedHostnameLookup(const QHostInfo&))); QHostInfo::lookupHost(_hostname, this, SLOT(completedHostnameLookup(const QHostInfo&)));
DependencyManager::get<NodeList>()->flagTimeForConnectionStep(NodeList::ConnectionStep::SetDomainHostname); DependencyManager::get<NodeList>()->flagTimeForConnectionStep(LimitedNodeList::ConnectionStep::SetDomainHostname);
UserActivityLogger::getInstance().changedDomain(_hostname); UserActivityLogger::getInstance().changedDomain(_hostname);
emit hostnameChanged(_hostname); emit hostnameChanged(_hostname);
@ -143,7 +143,7 @@ void DomainHandler::setIceServerHostnameAndID(const QString& iceServerHostname,
auto nodeList = DependencyManager::get<NodeList>(); auto nodeList = DependencyManager::get<NodeList>();
nodeList->flagTimeForConnectionStep(NodeList::ConnectionStep::SetICEServerHostname); nodeList->flagTimeForConnectionStep(LimitedNodeList::ConnectionStep::SetICEServerHostname);
if (_iceServerSockAddr.getAddress().isNull()) { if (_iceServerSockAddr.getAddress().isNull()) {
// connect to lookup completed for ice-server socket so we can request a heartbeat once hostname is looked up // connect to lookup completed for ice-server socket so we can request a heartbeat once hostname is looked up
@ -161,14 +161,14 @@ void DomainHandler::setIceServerHostnameAndID(const QString& iceServerHostname,
} }
void DomainHandler::activateICELocalSocket() { void DomainHandler::activateICELocalSocket() {
DependencyManager::get<NodeList>()->flagTimeForConnectionStep(NodeList::ConnectionStep::SetDomainSocket); DependencyManager::get<NodeList>()->flagTimeForConnectionStep(LimitedNodeList::ConnectionStep::SetDomainSocket);
_sockAddr = _icePeer.getLocalSocket(); _sockAddr = _icePeer.getLocalSocket();
_hostname = _sockAddr.getAddress().toString(); _hostname = _sockAddr.getAddress().toString();
emit completedSocketDiscovery(); emit completedSocketDiscovery();
} }
void DomainHandler::activateICEPublicSocket() { void DomainHandler::activateICEPublicSocket() {
DependencyManager::get<NodeList>()->flagTimeForConnectionStep(NodeList::ConnectionStep::SetDomainSocket); DependencyManager::get<NodeList>()->flagTimeForConnectionStep(LimitedNodeList::ConnectionStep::SetDomainSocket);
_sockAddr = _icePeer.getPublicSocket(); _sockAddr = _icePeer.getPublicSocket();
_hostname = _sockAddr.getAddress().toString(); _hostname = _sockAddr.getAddress().toString();
emit completedSocketDiscovery(); emit completedSocketDiscovery();
@ -179,7 +179,7 @@ void DomainHandler::completedHostnameLookup(const QHostInfo& hostInfo) {
if (hostInfo.addresses()[i].protocol() == QAbstractSocket::IPv4Protocol) { if (hostInfo.addresses()[i].protocol() == QAbstractSocket::IPv4Protocol) {
_sockAddr.setAddress(hostInfo.addresses()[i]); _sockAddr.setAddress(hostInfo.addresses()[i]);
DependencyManager::get<NodeList>()->flagTimeForConnectionStep(NodeList::ConnectionStep::SetDomainSocket); DependencyManager::get<NodeList>()->flagTimeForConnectionStep(LimitedNodeList::ConnectionStep::SetDomainSocket);
qCDebug(networking, "DS at %s is at %s", _hostname.toLocal8Bit().constData(), qCDebug(networking, "DS at %s is at %s", _hostname.toLocal8Bit().constData(),
_sockAddr.getAddress().toString().toLocal8Bit().constData()); _sockAddr.getAddress().toString().toLocal8Bit().constData());
@ -197,7 +197,7 @@ void DomainHandler::completedHostnameLookup(const QHostInfo& hostInfo) {
void DomainHandler::completedIceServerHostnameLookup() { void DomainHandler::completedIceServerHostnameLookup() {
qDebug() << "ICE server socket is at" << _iceServerSockAddr; qDebug() << "ICE server socket is at" << _iceServerSockAddr;
DependencyManager::get<NodeList>()->flagTimeForConnectionStep(NodeList::ConnectionStep::SetICEServerSocket); DependencyManager::get<NodeList>()->flagTimeForConnectionStep(LimitedNodeList::ConnectionStep::SetICEServerSocket);
// emit our signal so we can send a heartbeat to ice-server immediately // emit our signal so we can send a heartbeat to ice-server immediately
emit iceSocketAndIDReceived(); emit iceSocketAndIDReceived();
@ -301,7 +301,7 @@ void DomainHandler::processICEResponsePacket(const QByteArray& icePacket) {
NetworkPeer packetPeer; NetworkPeer packetPeer;
iceResponseStream >> packetPeer; iceResponseStream >> packetPeer;
DependencyManager::get<NodeList>()->flagTimeForConnectionStep(NodeList::ConnectionStep::ReceiveDSPeerInformation); DependencyManager::get<NodeList>()->flagTimeForConnectionStep(LimitedNodeList::ConnectionStep::ReceiveDSPeerInformation);
if (packetPeer.getUUID() != _iceDomainID) { if (packetPeer.getUUID() != _iceDomainID) {
qCDebug(networking) << "Received a network peer with ID that does not match current domain. Will not attempt connection."; qCDebug(networking) << "Received a network peer with ID that does not match current domain. Will not attempt connection.";

View file

@ -586,7 +586,7 @@ void NodeList::pingInactiveNodes() {
pingPunchForInactiveNode(node); pingPunchForInactiveNode(node);
if (node->getType() == NodeType::AudioMixer) { if (node->getType() == NodeType::AudioMixer) {
flagTimeForConnectionStep(NodeList::ConnectionStep::SendAudioPing); flagTimeForConnectionStep(LimitedNodeList::ConnectionStep::SendAudioPing);
} }
} }
}); });
@ -611,6 +611,6 @@ void NodeList::activateSocketFromNodeCommunication(const QByteArray& packet, con
} }
if (sendingNode->getType() == NodeType::AudioMixer) { if (sendingNode->getType() == NodeType::AudioMixer) {
flagTimeForConnectionStep(NodeList::ConnectionStep::SetAudioMixerSocket); flagTimeForConnectionStep(LimitedNodeList::ConnectionStep::SetAudioMixerSocket);
} }
} }