$this->lastSocketError = $socketInstance->getLastSocketErrorCode();
// Is it valid?
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('TCP-RAW-DATA-HANDLER: this->lastSocketError(%d)=%s', $this->lastSocketError, socket_strerror($this->lastSocketError)));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('TCP-RAW-DATA-HANDLER: this->lastSocketError(%d)=%s', $this->lastSocketError, $socketInstance->getLastSocketErrorMessage()));
if ($this->lastSocketError == 11) {
/*
* Error code 11 (Resource temporary unavailable) can be safely
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('TCP-RAW-DATA-HANDLER: Ignoring error 11 (Resource temporary unavailable) from socketResource=%s - CONTINUE!', $socketInstance->getSocketResource()));
$socketInstance->clearLastSocketError();
+ // Is there anything to add to the stacker?
+ if (!empty($rawData)) {
+ // Add it to stacker
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('TCP-RAW-DATA-HANDLER: Adding %d(%s) bytes to stacker ...', strlen($rawData), $rawData));
+ $this->addRawDataToStacker($rawData);
+ }
+
// Skip any further processing
continue;
} elseif (($rawData === FALSE) || ($this->lastSocketError > 0)) {
// Network error or connection lost
- /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('TCP-RAW-DATA-HANDLER: rawData[]=%s,this->lastSocketError=%s detected. - BREAK!', gettype($rawData), socket_strerror($this->lastSocketError)));
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('TCP-RAW-DATA-HANDLER: rawData[]=%s,this->lastSocketError=%s detected. - BREAK!', gettype($rawData), $socketInstance->getLastSocketErrorMessage()));
$this->setErrorCode($this->lastSocketError);
break;
} elseif (empty($rawData)) {