$sentBytes = socket_write($this->getSocketResource(), $socketBuffer[NetworkPackageHandler::RAW_INDEX_ENCODED_DATA], $bufferSize);
// Check if the operation was okay
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: sentBytes[%s]=%d', strtoupper($this->getSocketProtocol()), gettype($sentBytes), $sentBytes));
// @TODO Maybe check more?
$result = ($sentBytes !== FALSE);
$bufferSize = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry($this->getProtocolName() . '_buffer_length');
// Encode the raw data with our output-stream
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-CONNECTION-HELPER: bufferSize=%d,rawData()=%d, socketResource[%s]=%s', $bufferSize, strlen($rawData), gettype($this->getSocketInstance()->getSocketResource()), $this->getSocketInstance()->getSocketResource()));
+ $encodedData = $this->getOutputStreamInstance()->streamData($rawData);
+
+ // Create data array
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-CONNECTION-HELPER: bufferSize=%d,rawData()=%d, this->socketResource[%s]=%s', $bufferSize, strlen($rawData), gettype($this->getSocketInstance()->getSocketResource()), $this->getSocketInstance()->getSocketResource()));
$encodedDataArray = [
NetworkPackageHandler::RAW_INDEX_FINAL_HASH => $this->currentFinalHash,
- NetworkPackageHandler::RAW_INDEX_ENCODED_DATA => $this->getOutputStreamInstance()->streamData($rawData),
+ NetworkPackageHandler::RAW_INDEX_ENCODED_DATA => $encodedData,
NetworkPackageHandler::RAW_INDEX_SENT_BYTES => 0,
NetworkPackageHandler::RAW_INDEX_SOCKET_INSTANCE => $this->getSocketInstance(),
NetworkPackageHandler::RAW_INDEX_BUFFER_SIZE => $bufferSize,
];
// Push raw data to the package's outgoing stack
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-CONNECTION-HELPER: Pushing %d large array on stack %s ...', count($encodedDataArray), NetworkPackageHandler::STACKER_NAME_OUTGOING_STREAM));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-CONNECTION-HELPER: Pushing encodedDataArray()=%d on stack %s ...', count($encodedDataArray), NetworkPackageHandler::STACKER_NAME_OUTGOING_STREAM));
$this->getPackageHandlerInstance()->getStackInstance()->pushNamed(NetworkPackageHandler::STACKER_NAME_OUTGOING_STREAM, $encodedDataArray);
// Trace message