// We do some rudimentary checks but this might be a bit ugly
switch ($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT]) {
// All upper hubs, these are currently the bootstrap nodes and later on prepended list-nodes
- case NetworkPackage::NETWORK_TARGET_UPPER_HUBS:
+ 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;
/**
* Tries to discover all recipients by given decoded package data.
*
- * @param $decodedData Decoded raw package data array
+ * @param $decodedData Raw raw package data array
* @return void
* @todo Add some validation of recipient field, e.g. ip:port is found
* @todo The if() does only check for TCP, not UDP, e.g. try to get a $handlerInstance here
*/
- public function discoverDecodedRecipients (array $decodedData) {
+ public function discoverRawRecipients (array $decodedData) {
// First clear all recipients
$this->clearRecipients();