* @return void
*/
function handlePendingData ();
+
+ /**
+ * Checks whether the assembler has multiple messages pending
+ *
+ * @return $isPending Whether the assembler has multiple messages pending
+ */
+ function ifMultipleMessagesPending ();
+
+ /**
+ * Handles multiple messages.
+ *
+ * @return void
+ */
+ function handleMultipleMessages ();
}
// [EOF]
* @return void
*/
function handleRawData (array $decodedData);
+
+ /**
+ * Checks whether the assembler has multiple messages pending
+ *
+ * @return $isPending Whether the assembler has multiple messages pending
+ */
+ function ifMultipleMessagesPending ();
+
+ /**
+ * Handles multiple messages.
+ *
+ * @return void
+ */
+ function handleMultipleMessages ();
}
// [EOF]
return $ifPendingDataIsEmpty;
}
+ /**
+ * Checks whether the assembler has multiple messages pending
+ *
+ * @return $isPending Whether the assembler has multiple messages pending
+ */
+ public function ifMultipleMessagesPending () {
+ // Determine it
+ $isPending = (!$this->getStackerInstance()->isStackEmpty(self::STACKER_NAME_MULTIPLE_MESSAGE);
+
+ // Return it
+ return $isPending;
+ }
+
+ /**
+ * Handles multiple messages.
+ *
+ * @return void
+ * @todo 0% done
+ */
+ public function handleMultipleMessages () {
+ $this->partialStub('Unfinished method.');
+ }
+
/**
* Handles the assembler's pending data
*
return $isHandled;
}
+ /**
+ * Checks whether the assembler has multiple packages pending
+ *
+ * @return $isPending Whether the assembler has multiple packages pending
+ */
+ public function ifMultipleMessagesPending () {
+ // Determine if the stack is not empty
+ $isPending = (!$this->getAssemblerInstance()->ifMultipleMessagesPending());
+
+ // Return it
+ return $isPending;
+ }
+
/**
* Handles the attached assemler's pending data queue to be finally
* assembled to the raw package data back.
$this->getAssemblerInstance()->handlePendingData();
}
+ /**
+ * Handles multiple messages.
+ *
+ * @return void
+ */
+ public function handleMultipleMessages () {
+ // Handle it
+ $this->getAssemblerInstance()->handleMultipleMessages();
+ }
+
/**
* Assembles incoming decoded data so it will become an abstract network
* package again. The assembler does later do it's job by an other task,
* for further details (what array elements are required et cetera).
*/
$packageInstance->assembleDecodedDataToPackage();
+ } elseif ($packageInstance->ifMultipleMessagesPending()) {
+ /*
+ * Some raw data contained multiple messages which where now splitted.
+ */
+ $packageInstance->handleMultipleMessages();
} elseif ($packageInstance->isNewRawDataPending($this->getListenerPoolInstance())) {
// Raw, decoded data has been received
$packageInstance->handleIncomingDecodedData();