// All upper hubs, these are currently the bootstrap nodes and later on prepended list-nodes
case NetworkPackage::NETWORK_TARGET_UPPER_NODES:
// Get all bootstrap nodes
- foreach (explode(BaseHubSystem::BOOTSTRAP_NODES_SEPARATOR, $this->getConfigInstance()->getConfigEntry('hub_bootstrap_nodes')) as $node) {
+ foreach (explode(BaseHubSystem::BOOTSTRAP_NODES_SEPARATOR, $this->getConfigInstance()->getConfigEntry('hub_bootstrap_nodes')) as $ipPort) {
// Is maximum reached?
if ($this->getListInstance()->count() == $this->getConfigInstance()->getConfigEntry('package_recipient_max_count')) {
// Debug message
} // END - if
// Debug message
- /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DISCOVERY: Adding node ' . $node . ' as recipient.');
+ /* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DISCOVERY: Adding node ' . $ipPort . ' as recipient.');
// Add the entry
- $this->getListInstance()->addEntry('ip_port', $node);
+ $this->getListInstance()->addEntry('ip_port', $ipPort);
} // END - foreach
break;
// The target 'self' is always the external IP address!
case NetworkPackage::NETWORK_TARGET_SELF:
// Determine own port
- $port = $this->getConfigInstance()->getConfigEntry('node_' . $this->determineProtocolByPackageData($packageData) . '_listen_port');
+ $port = $this->getConfigInstance()->getConfigEntry('node_listen_port');
// Determine IP or 'external_ip' if set
$ip = HubTools::determineOwnExternalIp();
$recipient = explode(':', $decodedData[NetworkPackage::PACKAGE_DATA_RECIPIENT]);
// Is the 'recipient' field same as this peer's IP?
- if ((($recipient[0] == HubTools::determineOwnExternalIp()) && ($recipient[1] == $this->getConfigInstance()->getConfigEntry('node_tcp_listen_port'))) || ($recipient[0] == $this->getConfigInstance()->getServerAddress())) {
+ if ((($recipient[0] == HubTools::determineOwnExternalIp()) && ($recipient[1] == $this->getConfigInstance()->getConfigEntry('node_listen_port'))) || ($recipient[0] == $this->getConfigInstance()->getServerAddress())) {
/*
- * Is same as own external IP+TCP port or internal IP, don't do anything here so other
+ * Is same as own external IP + TCP/UDP listen port or internal IP, don't do anything here so other
* classes found an empty recipient list for internal (own) handling
* of the original content.
*/