]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/package/class_NetworkPackage.php
Internal TODO closed, description of NetworkPackage class updated
[hub.git] / application / hub / main / package / class_NetworkPackage.php
index a9a8a543e1b7d702f9a648b80305a4199fe38ad6..ddc95fe874eb8336a00ac4f3a535b2c74cdc6933 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /**
- * A NetworkPackage class. This class implements the Deliverable class because
- * all network packages should be deliverable to other nodes. It further
- * provides methods for reading raw content from template engines and feeding it
- * to the stacker for undeclared packages.
+ * A NetworkPackage class. This class implements Deliverable because all network
+ * packages should be deliverable to other nodes. It further provides methods
+ * for reading raw content from template engines and feeding it to the stacker
+ * for undeclared packages.
  *
  * The factory method requires you to provide a compressor class (which must
  * implement the Compressor interface). If you don't want any compression (not
@@ -11,7 +11,7 @@
  * class and encode it with BASE64 for a more error-free transfer over the
  * Internet.
  *
- * For performance reasons, this class should only be instantiated once and then
+ * For performance reasons, this class should only be instanciated once and then
  * used as a "pipe-through" class.
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
 class NetworkPackage extends BaseFrameworkSystem implements Deliverable, Registerable {
        /**
         * Package mask for compressing package data:
-        * 1.) Compressor extension
-        * 2.) Raw package data
-        * 3.) Tags, seperated by semicolons, no semicolon is required if only one tag is needed
-        * 4.) Checksum
+        * 0: Compressor extension
+        * 1: Raw package data
+        * 2: Tags, seperated by semicolons, no semicolon is required if only one tag is needed
+        * 3: Checksum
+        *                     0  1  2  3
         */
        const PACKAGE_MASK = '%s:%s:%s:%s';
 
@@ -405,13 +406,13 @@ class NetworkPackage extends BaseFrameworkSystem implements Deliverable, Registe
         * @return      void
         */
        public function sendWaitingPackage () {
-               // Sent any waiting bytes in the back-buffer
+               // Send any waiting bytes in the back-buffer before sending a new package
                $this->sendBackBufferBytes();
 
                // Sanity check if we have packages waiting for delivery
                if (!$this->isPackageWaitingForDelivery()) {
                        // This is not fatal but should be avoided
-                       // @TODO Add some logging here
+                       $this->debugOutput('PACKAGE: No package is waiting for delivery, but ' . __FUNCTION__ . ' was called.');
                        return;
                } // END - if