From: Roland Haeder Date: Sat, 15 Feb 2014 22:35:33 +0000 (+0100) Subject: Need this again for debugging. :-( X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6c78ccb9433d1b0824add417607347ab072c0a91;p=hub.git Need this again for debugging. :-( Signed-off-by: Roland Haeder --- diff --git a/application/hub/main/helper/connection/class_BaseConnectionHelper.php b/application/hub/main/helper/connection/class_BaseConnectionHelper.php index 05e55d2d4..107de09f3 100644 --- a/application/hub/main/helper/connection/class_BaseConnectionHelper.php +++ b/application/hub/main/helper/connection/class_BaseConnectionHelper.php @@ -397,11 +397,11 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, // Fill sending buffer with data while (strlen($dataStream) > 0) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: packageData=' . print_r($packageData, TRUE)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: packageData=' . print_r($packageData, TRUE)); // Convert the package data array to a raw data stream $dataStream = $this->getRawDataFromPackageArray($packageData); - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: Adding ' . strlen($dataStream) . ' bytes to the sending buffer ...'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: Adding ' . strlen($dataStream) . ' bytes to the sending buffer ...'); $rawData .= $dataStream; } // END - while @@ -412,7 +412,7 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, $encodedData = $this->getOutputStreamInstance()->streamData($rawData); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: rawData()=' . strlen($rawData) . ',encodedData()=' . strlen($encodedData)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: rawData()=' . strlen($rawData) . ',encodedData()=' . strlen($encodedData)); // Calculate difference $this->diff = $bufferSize - strlen($encodedData); @@ -426,15 +426,15 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, // Deliver all data while ($sentBytes !== FALSE) { // And deliver it - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: Sending out ' . strlen($encodedData) . ' bytes,bufferSize=' . $bufferSize . ',diff=' . $this->diff); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: Sending out ' . strlen($encodedData) . ' bytes,bufferSize=' . $bufferSize . ',diff=' . $this->diff); if ($this->diff >= 0) { // Send all out (encodedData is smaller than or equal buffer size) - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: MD5=' . md5(substr($encodedData, 0, ($bufferSize - $this->diff)))); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: MD5=' . md5(substr($encodedData, 0, ($bufferSize - $this->diff)))); $sentBytes = socket_write($socketResource, $encodedData, ($bufferSize - $this->diff)); } else { // Send buffer size out - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: MD5=' . md5(substr($encodedData, 0, $bufferSize))); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: MD5=' . md5(substr($encodedData, 0, $bufferSize))); $sentBytes = socket_write($socketResource, $encodedData, $bufferSize); } @@ -447,7 +447,7 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, throw new InvalidSocketException(array($this, $socketResource, $socketError, $errorMessage), BaseListener::EXCEPTION_INVALID_SOCKET); } elseif (($sentBytes == 0) && (strlen($encodedData) > 0)) { // Nothing sent means we are done - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: All sent! (LINE=' . __LINE__ . ')'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: All sent! (LINE=' . __LINE__ . ')'); break; } @@ -458,7 +458,7 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, $totalSentBytes += $sentBytes; // Cut out the last unsent bytes - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: Sent out ' . $sentBytes . ' of ' . strlen($encodedData) . ' bytes ...'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: Sent out ' . $sentBytes . ' of ' . strlen($encodedData) . ' bytes ...'); $encodedData = substr($encodedData, $sentBytes); // Calculate difference again @@ -467,13 +467,13 @@ class BaseConnectionHelper extends BaseHubSystemHelper implements Registerable, // Can we abort? if (strlen($encodedData) <= 0) { // Abort here, all sent! - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: All sent! (LINE=' . __LINE__ . ')'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: All sent! (LINE=' . __LINE__ . ')'); break; } // END - if } // END - while // Return sent bytes - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: totalSentBytes=' . $totalSentBytes . ',diff=' . $this->diff); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __LINE__ . ']: totalSentBytes=' . $totalSentBytes . ',diff=' . $this->diff); return $totalSentBytes; }