* @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);
*/
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;