<?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
* 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';
* @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