* @throws FrameworkException Could throw different exceptions depending on implementation
*/
public function resolveRecipient ($recipient, Listable $listInstance, array $packageData) {
+ // Debug message
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-RECIPIENT: recipient=' . $recipient . ' - CALLED!');
+
// Make sure the recipient is valid
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-RECIPIENT: recipient=' . $recipient);
assert($recipient == NetworkPackage::NETWORK_TARGET_DHT);
// Get recipient discovery instance
// Now "walk" through all elements and add them to the list
foreach ($recipients as $recipient) {
// These array elements must exist for this loop:
- assert(isset($recipient[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_EXTERNAL_IP]));
- assert(isset($recipient[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_LISTEN_PORT]));
+ assert(!empty($recipient[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_EXTERNAL_IP]));
+ assert(!empty($recipient[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_LISTEN_PORT]));
// Put ip and port both together
$ipPort = $recipient[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_EXTERNAL_IP] . ':' . $recipient[NodeDistributedHashTableDatabaseWrapper::DB_COLUMN_LISTEN_PORT];
// Add it to the list
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-RECIPIENT: Calling listInstance->addEntry(' . $ipPort . ') ...');
$listInstance->addEntry('ip_port', $ipPort);
} // END - foreach
+
+ // Debug message
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DHT-RECIPIENT: recipient=' . $recipient . ' - EXIT!');
}
}