More debug lines and renamed ->
authorRoland Häder <roland@mxchange.org>
Sat, 19 May 2012 10:52:12 +0000 (10:52 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 19 May 2012 10:52:12 +0000 (10:52 +0000)
inc/classes/main/container/socket/class_SocketContainer.php

index 3794084971b5938fa5bf68e4e9c814032dc9738c..9a172d0cc3e7b339e66f97f97fda24939a68802d 100644 (file)
@@ -40,10 +40,13 @@ class SocketContainer extends BaseContainer implements Registerable {
         * @param       $packageData            Raw package data
         * @return      $containerInstance      An instance of this Container class
         */
         * @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();
 
                // 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);
 
                // 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
         */
        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?
 
                // 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;
 
                // Return result
                return $matches;