// Found in cache!
$recipient = $selfInstance->sessionIdCache[$sessionId];
+
+ // Debug message
+ $selfInstance->debugOutput('HUB-TOOLS: sessionIdCache[' . $sessionId . ']=' . $recipient);
} elseif (preg_match('/([a-zA-Z0-9]([a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,6}:([0-9]{3,5})/', $sessionId)) {
+ // Hostname:port found
+ $selfInstance->debugOutput('HUB-TOOLS: hostname:port ' . $sessionId . ' detected.');
+
// Hostname:port found
$hostnameArray = explode(':', $sessionId);
// Try to resolve it and add port again
- // @TODO We may want to encapsulate this PHP call into an own class
+ // @TODO Please try to encapsulate this PHP call into an own class
$recipient = gethostbyname($hostnameArray[0]) . ':' . $hostnameArray[1];
// Is it valid?
// Resolving hostname->IP failed!
throw new NoValidHostnameException($hostnameArray, self::EXCEPTION_HOSTNAME_NOT_FOUND);
} // END - if
+
+ // Debug message
+ $selfInstance->debugOutput('HUB-TOOLS: hostname:port ' . $sessionId . ' resolved to ' . $recipient);
} elseif (preg_match('/([a-f0-9]{' . $selfInstance->getSessionIdLength() . '})/', $sessionId)) {
// Debug message
$selfInstance->debugOutput('HUB-TOOLS: Using internal session id resolver.');
// Resolve session id into a ip:port combination
$recipient = $selfInstance->resolveIpPortBySessionId($sessionId);
+
+ // Debug message
+ $selfInstance->debugOutput('HUB-TOOLS: session id ' . $sessionId . ' resolved to ' . $recipient);
} else {
// Invalid session id
throw new InvalidSessionIdException($sessionId, self::EXCEPTION_SESSION_ID_IS_INVALID);
}
- // Output message
- $selfInstance->debugOutput('HUB-TOOLS: Session id ' . $sessionId . ' resolved to ' . $recipient);
-
// Return it
return $recipient;
}