function getRegisteredSocketResource (Listenable $listenerInstance);
/**
- * "Getter" for protocol/connection instance from given package data
+ * "Getter" for info instance from given package data
*
- * @param $packageData Raw package data
- * @return $protocolInstance An instance of a HandleableProtocol class
+ * @param $packageData Raw package data
+ * @return $infoInstance An instance of a ShareableInfo class
*/
- function getHandlerInstanceFromPackageData (array $packageData);
+ function getInfoInstanceFromPackageData (array $packageData);
}
// [EOF]
// Is the info instance set?
if ($infoInstance instanceof ShareableInfo) {
- // Get listener from info class
+ // Get listener/helper from info class
$listenerInstance = $infoInstance->getListenerInstance();
+ $helperInstance = $infoInstance->getHelperInstance();
+
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-CONTAINER[' . __METHOD__ . ':' . __LINE__ . ']: listenerInstance[]=' . gettype($listenerInstance));
// Is there a listener instance set?
if ($listenerInstance instanceof Listenable) {
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-CONTAINER[' . __METHOD__ . ':' . __LINE__ . ']: Setting listenerInstance=' . $listenerInstance->__toString() . ' ...');
+
// Set it here for later usage
$containerInstance->setListenerInstance($listenerInstance);
- } // END - if
+ } elseif ($helperInstance instanceof ConnectionHelper) {
+ // Debug message
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-CONTAINER[' . __METHOD__ . ':' . __LINE__ . ']: Setting helperInstance=' . $helperInstance->__toString() . ' ...');
+
+ // Set it here for later usage
+ $containerInstance->setHelperInstance($helperInstance);
+ }
} // END - if
// Set the resource ...
$packageData = $this->getPackageData();
// Debug message
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-CONTAINER: unl=' . $unl . ',packageData=' . print_r($packageData, TRUE));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-CONTAINER[' . __METHOD__ . ':' . __LINE__ . ']: unl=' . $unl . ',packageData=' . print_r($packageData, TRUE));
// So, does both match?
$matches = ((isset($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT])) && ($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT] === $unl));
*/
public final function ifSocketResourceMatches ($socketResource) {
// Debug message
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-CONTAINER: socketResource[' . gettype($socketResource) . ']=' .$socketResource . ',storedResource[' . gettype($this->getSocketResource()) . ']=' . $this->getSocketResource());
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-CONTAINER[' . __METHOD__ . ':' . __LINE__ . ']: socketResource[' . gettype($socketResource) . ']=' .$socketResource . ',storedResource[' . gettype($this->getSocketResource()) . ']=' . $this->getSocketResource());
// So, does both match?
$matches = ((is_resource($socketResource)) && ($socketResource === $this->getSocketResource()));