const PACKAGE_STATUS_NEW = 'new';
const PACKAGE_STATUS_FAILED = 'failed';
const PACKAGE_STATUS_DECODED = 'decoded';
+ const PACKAGE_STATUS_FAKED = 'faked';
/**
* Constants for message data array
// Debug message
$this->debugOutput('POOL: Adding peer ' . $peerName . ',socketResource=' . $socketResource);
+ // Create the fake array
+ $packageData = array(
+ NetworkPackage::PACKAGE_DATA_SENDER => $peerName . ':0',
+ NetworkPackage::PACKAGE_DATA_RECIPIENT => $this->getSessionId(),
+ NetworkPackage::PACKAGE_DATA_PROTOCOL => $this->getListenerInstance()->getProtocol(),
+ NetworkPackage::PACKAGE_DATA_STATUS => NetworkPackage::PACKAGE_STATUS_FAKED
+ );
+
+ // Get a socket registry
+ $registryInstance = SocketRegistryFactory::createSocketRegistryInstance();
+
+ // Register the socket with the registry and with a half-fake array
+ $registryInstance->registerSocket($this->getListenerInstane(), $socketResource, $packageData);
+
// Add it finally to the pool
$this->addPoolEntry($socketResource);
}