$discoveryInstance->setListInstance($listInstance);
// Output debug message
- self::createDebugInstance(__CLASS__)->debugOutput('RECIPIENT-DISCOVERY: Initialized.');
+ self::createDebugInstance(__CLASS__)->debugOutput('RECIPIENT-DISCOVERY[' . __LINE__ . ']: Initialized.');
// Return the prepared instance
return $discoveryInstance;
* @return void
*/
public function discoverRecipients (array $packageData) {
+ // This must be available
+ assert(isset($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT]));
+
// First try out the direct recipient (session id)
try {
// Get instance (should not break)
$recipientInstance = ObjectFactory::createObjectByConfiguredName(strtolower($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT]) . '_recipient_class');
// And try to solve again
- $recipientInstance->resolveRecipient('', $this->getListInstance());
+ $recipientInstance->resolveRecipient($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT], $this->getListInstance());
} catch (FrameworkException $e) {
// Could not find class, what ever failed
$this->debugInstance($e->getMessage());
* @todo The if() does only check for TCP, not UDP, e.g. try to get a $handlerInstance here
*/
public function discoverRawRecipients (array $decodedData) {
+ // This must be available
+ assert(isset($decodedData[NetworkPackage::PACKAGE_DATA_RECIPIENT]));
+
// First clear all recipients
$this->clearRecipients();
*/
// Debug output (may flood)
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('RECIPIENT-DISCOVERY: Recipient ' . $recipient[0] . ' matches own ip (' . HubTools::determineOwnExternalIp() . ' or ' . $this->getConfigInstance()->getServerAddress() . ')');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('RECIPIENT-DISCOVERY[' . __LINE__ . ']: Recipient ' . $recipient[0] . ' matches own ip (' . HubTools::determineOwnExternalIp() . ' or ' . $this->getConfigInstance()->getServerAddress() . ')');
} else {
// Debug output (may flood)
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('RECIPIENT-DISCOVERY: Recipient ' . $recipient[0] . ' is different than own external ip (' . HubTools::determineOwnExternalIp() . ') nor internal ip (' . $this->getConfigInstance()->getServerAddress() . '), need to forward (not yet implemented)!');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('RECIPIENT-DISCOVERY[' . __LINE__ . ']: Recipient ' . $recipient[0] . ' is different than own external ip (' . HubTools::determineOwnExternalIp() . ') nor internal ip (' . $this->getConfigInstance()->getServerAddress() . '), need to forward (not yet implemented)!');
// This package is to be delivered to someone else, so add it
$this->getListInstance()->addEntry('ip_port', $decodedData[NetworkPackage::PACKAGE_DATA_RECIPIENT]);