*
* @param $packageData Raw package data array
* @return void
+ * @todo Find a better way than this switch/case/default thing
*/
public function discoverRecipients (array $packageData) {
// 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_NODES:
+ case NetworkPackage::NETWORK_TARGET_UPPER_NODES: // All upper hubs, these are currently the bootstrap nodes and later on prepended list-nodes
// Get all bootstrap nodes
foreach (explode(BaseHubSystem::BOOTSTRAP_NODES_SEPARATOR, $this->getConfigInstance()->getConfigEntry('hub_bootstrap_nodes')) as $ipPort) {
// Is maximum reached?
} // END - foreach
break;
- // The target 'self' is always the external IP address!
- case NetworkPackage::NETWORK_TARGET_SELF:
+ case NetworkPackage::NETWORK_TARGET_SELF: // The target 'self' is always the external IP address!
// Determine own port
$port = $this->getConfigInstance()->getConfigEntry('node_listen_port');
} // END - if
break;
- // This may be a direct recipient (node's session id)
- default:
+ case NetworkPackage::NETWORK_TARGET_DHT: // The target 'dht' is a list from local DHT query
+ $this->partialStub('DHT recipient unimplemented: packageData=' . print_r($packageData, true));
+ break;
+
+ default: // This may be a direct recipient (node's session id)
/*
* Try to solve it, if an exception comes back, it is not a
* session-id, nor IP:port and not a hostname:port combination.