From: Roland Häder Date: Sat, 19 May 2012 10:52:12 +0000 (+0000) Subject: More debug lines and renamed -> X-Git-Url: https://git.mxchange.org/?p=core.git;a=commitdiff_plain;h=8388b0ef4894097cbd2f44d0efb29e1d8e64a728 More debug lines and renamed -> --- diff --git a/inc/classes/main/container/socket/class_SocketContainer.php b/inc/classes/main/container/socket/class_SocketContainer.php index 37940849..9a172d0c 100644 --- a/inc/classes/main/container/socket/class_SocketContainer.php +++ b/inc/classes/main/container/socket/class_SocketContainer.php @@ -40,10 +40,13 @@ class SocketContainer extends BaseContainer implements Registerable { * @param $packageData Raw package data * @return $containerInstance An instance of this Container class */ - public static final function createSocketContainer ($socketResource, ProtocolHandler $protocolInstance = NULL, array $packageData) { + public static final function createSocketContainer ($socketResource, ProtocolHandler $protocolInstance = NULL, array $packageData = array()) { // Get a new instance $containerInstance = new SocketContainer(); + // Debug message + /* NOISY-DEBUG: */ $containerInstance->debugOutput(__METHOD__ . ':socketResource=' . $socketResource . ',packageData='.print_r($packageData,true)); + // Set the resource ... $containerInstance->setSocketResource($socketResource); @@ -65,10 +68,13 @@ class SocketContainer extends BaseContainer implements Registerable { */ public final function ifAddressMatches ($addressPort) { // Get current package data - $data = $this->getPackageData(); + $packageData = $this->getPackageData(); + + // Debug message + /* NOISY-DEBUG: */ $this->debugOutput('SOCKET-CONTAINER: addressPort=' . $addressPort . ',packageData=' . print_r($packageData, true)); // So, does both match? - $matches = ((isset($data['recipient'])) && ($data['recipient'] === $addressPort)); + $matches = ((isset($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT])) && ($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT] === $addressPort)); // Return result return $matches;