X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=application%2Fhub%2Fmain%2Fpackage%2Fclass_NetworkPackage.php;h=9a4ce15df1299ad6ad4c3ec5ec91a52ea0435269;hb=d391ecd222ae868265735539d68a2c148711b5e3;hp=64d3a8f57bffd7fd4f8369aa2ee5a8ac19a12882;hpb=fb17cbd9e3f841ea478f1f88f4efa0422a7ebd69;p=hub.git diff --git a/application/hub/main/package/class_NetworkPackage.php b/application/hub/main/package/class_NetworkPackage.php index 64d3a8f57..9a4ce15df 100644 --- a/application/hub/main/package/class_NetworkPackage.php +++ b/application/hub/main/package/class_NetworkPackage.php @@ -1,9 +1,10 @@ . */ -class NetworkPackage extends BaseFrameworkSystem implements Deliverable, Registerable { +class NetworkPackage extends BaseFrameworkSystem implements Deliverable, Receivable, Registerable { /** * Package mask for compressing package data: * 0: Compressor extension @@ -106,7 +107,7 @@ class NetworkPackage extends BaseFrameworkSystem implements Deliverable, Registe const NETWORK_TARGET_SELF = 'self'; /** - * TCP package size + * TCP package size in bytes */ const TCP_PACKAGE_SIZE = 512; @@ -167,6 +168,10 @@ class NetworkPackage extends BaseFrameworkSystem implements Deliverable, Registe return $hash; } + /////////////////////////////////////////////////////////////////////////// + // Delivering packages / raw data + /////////////////////////////////////////////////////////////////////////// + /** * Delivers the given raw package data. * @@ -270,7 +275,7 @@ class NetworkPackage extends BaseFrameworkSystem implements Deliverable, Registe return; } // END - if - // Sent it away (we catch exceptions one method above + // Sent it away (we catch exceptions one method above) $sentBytes = $connectionInstance->sendRawPackageData($packageData); // Remember unsent raw bytes in back-buffer, if any @@ -427,7 +432,6 @@ class NetworkPackage extends BaseFrameworkSystem implements Deliverable, Registe try { // Now try to send it $this->sendOutgoingRawPackageData($packageData); - die("O!\n"); // And remove it finally $this->getStackerInstance()->popNamed(self::STACKER_NAME_OUTGOING); @@ -436,6 +440,28 @@ class NetworkPackage extends BaseFrameworkSystem implements Deliverable, Registe $this->debugOutput('PACKAGE: Package was not delivered: ' . $e->getMessage()); } } + + /////////////////////////////////////////////////////////////////////////// + // Receiving packages / raw data + /////////////////////////////////////////////////////////////////////////// + + /** + * Checks wether new raw package data has arrived at a socket + * + * @return $hasArrived Wether new raw package data has arrived for processing + */ + public function isNewRawDataPending () { + // @TODO Add some content here + } + + /** + * Checks wether a new package has arrived + * + * @return $hasArrived Wether a new package has arrived for processing + */ + public function isNewPackageArrived () { + // @TODO Add some content here + } } // [EOF]