- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Hub Developer Team
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub Developer Team
// Is an instance there?
if (is_null(self::$registryInstance)) {
// Not yet, so create one
// Is an instance there?
if (is_null(self::$registryInstance)) {
// Not yet, so create one
// Is the socket already registered?
if ($this->isSocketRegistered($protocolInstance, $socketResource)) {
// Throw the exception
// Is the socket already registered?
if ($this->isSocketRegistered($protocolInstance, $socketResource)) {
// Throw the exception
$socketInstance = ObjectFactory::CreateObjectByConfiguredName('socket_container_class', array($socketResource, $protocolInstance, $packageData));
// We have a sub-registry, the socket key and the socket, now we need to put all together
$socketInstance = ObjectFactory::CreateObjectByConfiguredName('socket_container_class', array($socketResource, $protocolInstance, $packageData));
// We have a sub-registry, the socket key and the socket, now we need to put all together
// Get all keys and check them
foreach ($this->getInstanceRegistry() as $key=>$registryInstance) {
// This is always a SubRegistry instance
foreach ($registryInstance->getInstanceRegistry() as $subKey=>$containerInstance) {
// This is a SocketContainer instance, so does the recipient match?
// Get all keys and check them
foreach ($this->getInstanceRegistry() as $key=>$registryInstance) {
// This is always a SubRegistry instance
foreach ($registryInstance->getInstanceRegistry() as $subKey=>$containerInstance) {
// This is a SocketContainer instance, so does the recipient match?
- if ($containerInstance->ifAddressMatches($packageData['recipient'])) {
- // Found one, so get the protocol instance and abort
+ if ($containerInstance->ifAddressMatches($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT])) {
+ // Found one, so get the protocol instance and abort any further search