// And make sure it is valid
assert($helperInstance instanceof ConnectionHelper);
+ // Get connection info class
+ $infoInstance = ConnectionInfoFactory::createConnectionInfoInstance();
+
+ // Will the info instance with connection helper data
+ $infoInstance->fillWithConnectionHelperInformation($helperInstance);
+
// Is it not there?
- if ((is_resource($socketResource)) && (!$registryInstance->isSocketRegistered($helperInstance, $socketResource))) {
+ if ((is_resource($socketResource)) && (!$registryInstance->isSocketRegistered($infoInstance, $socketResource))) {
// Debug message
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Registering socket ' . $socketResource . ' ...');
// Then register it
- $registryInstance->registerSocket($helperInstance, $socketResource, $packageData);
+ $registryInstance->registerSocket($infoInstance, $socketResource, $packageData);
} elseif (!$helperInstance->getStateInstance()->isPeerStateConnected()) {
// Is not connected, then we cannot send
self::createDebugInstance(__CLASS__)->debugOutput('NETWORK-PACKAGE[' . __METHOD__ . ':' . __LINE__ . ']: Unexpected peer state ' . $helperInstance->getStateInstance()->__toString() . ' detected.');
// Get the right connection instance
$helperInstance = SocketRegistryFactory::createSocketRegistryInstance()->getHandlerInstanceFromPackageData($packageData);
+ // Test helper instance
+ assert($helperInstance instanceof ConnectionHelper);
+
// Is this connection still alive?
if ($helperInstance->isShuttedDown()) {
// This connection is shutting down