assert(strlen($rawData) <= NetworkPackage::TCP_PACKAGE_SIZE);
// Add it to the array
- /* NOISY-DEBUG: */ $this->debugOutput('FRAGMENTER: Adding ' . strlen($rawData) . ' bytes of a chunk ...');
+ //* NOISY-DEBUG: */ $this->debugOutput('FRAGMENTER: Adding ' . strlen($rawData) . ' bytes of a chunk ...');
$this->chunks[$finalHash][] = $rawData;
$this->chunkHashes[$finalHash][] = $rawDataHash;
}
*/
public function executeTask () {
// Do we have something to handle?
- if ($this->getPackageInstance()->isNewRawDataPending($this->getListenerPoolInstance())) {
- // We have to handle raw data from the socket
- $this->getPackageInstance()->handleIncomingDecodedData();
+ if ($this->getPackageInstance()->isNewPackageArrived()) {
+ // Okay, then handle newly arrived package
+ $this->getPackageInstance()->handleNewlyArrivedPackage();
} elseif ($this->getPackageInstance()->isIncomingDecodedDataHandled()) {
/*
* We have handled decoded data so we should validate it, if we have
* network package.
*/
$this->getPackageInstance()->assembleDecodedDataToPackage();
- } elseif ($this->getPackageInstance()->isNewPackageArrived()) {
- // Okay, then handle newly arrived package
- $this->getPackageInstance()->handleNewlyArrivedPackage();
+ } elseif ($this->getPackageInstance()->isNewRawDataPending($this->getListenerPoolInstance())) {
+ // We have to handle raw data from the socket
+ $this->getPackageInstance()->handleIncomingDecodedData();
} // END - if
}
}
*/
public function executeTask () {
// Do we have something to deliver?
- if ($this->getPackageInstance()->isPackageEnqueued()) {
- // Okay, then deliver (better discover its recipients) this package
- $this->getPackageInstance()->declareEnqueuedPackage();
+ if ($this->getPackageInstance()->isPackageWaitingForDelivery()) {
+ // Sent it finally out
+ $this->getPackageInstance()->sendWaitingPackage();
} elseif ($this->getPackageInstance()->isPackageDeclared()) {
// Prepare package for delivery
$this->getPackageInstance()->deliverDeclaredPackage();
- } elseif ($this->getPackageInstance()->isPackageWaitingForDelivery()) {
- // Sent it finally out
- $this->getPackageInstance()->sendWaitingPackage();
+ } elseif ($this->getPackageInstance()->isPackageEnqueued()) {
+ // Okay, then deliver (better discover its recipients) this package
+ $this->getPackageInstance()->declareEnqueuedPackage();
}
}
}