*
* @author Roland Haeder <webmaster@ship-simu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub Developer Team
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Hub Developer Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.ship-simu.org
*
*/
function addAllChunksWithFinal (array $chunks);
+ /**
+ * Adds all chunks and wait for more (e.g. incomplete transmission)
+ *
+ * @param $chunks An array with chunks, the last one should be a 'final'
+ * @return void
+ */
+ function addAllChunksWait (array $chunks);
+
+ /**
+ * Checks whether unhandled chunks are available
+ *
+ * @return $unhandledChunks Whether unhandled chunks are left
+ */
+ function ifUnhandledChunksWithFinalAvailable ();
+
/**
* Handles available chunks by processing one-by-one (not all together,
* this would slow-down the whole application) with the help of an
*
* @return void
*/
- function handleAvailableChunks ();
+ function handleAvailableChunksWithFinal ();
+
+ /**
+ * Checks whether unassembled chunks are available (ready) in final array
+ *
+ * @return $unassembledChunksAvailable Whether unassembled chunks are available
+ */
+ function ifUnassembledChunksAvailable ();
+
+ /**
+ * Assembles all chunks (except EOP and "hash chunk") back together to the original package data.
+ *
+ * This is done by the following steps:
+ *
+ * 1) Sort the final array with ksort(). This will bring the "hash
+ * chunk" up to the last array index and the EOP chunk to the
+ * pre-last array index
+ * 2) Assemble all chunks except two last (see above step)
+ * 3) While so, do the final check on all hashes
+ * 4) If the package is assembled back together, hash it again for
+ * the very final verification.
+ *
+ * @return void
+ */
+ function assembleChunksFromFinalArray ();
+
+ /**
+ * Checks whether the raw package data has been assembled back together.
+ * This can be safely assumed when rawPackageData is not empty and the
+ * collection of all chunks is FALSE (because initHandler() will reset it).
+ *
+ * @return $isRawPackageDataAvailable Whether raw package data is available
+ */
+ function ifRawPackageDataIsAvailable ();
+
+ /**
+ * Handles the finally assembled raw package data by feeding it into another
+ * stacker for further decoding/processing.
+ *
+ * @return void
+ */
+ function handledAssembledRawPackageData ();
}
// [EOF]