// Import framework stuff
use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
+use Org\Mxchange\CoreFramework\EntryPoint\ApplicationEntryPoint;
use Org\Mxchange\CoreFramework\Factory\Database\Frontend\DatabaseFrontendFactory;
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
use Org\Mxchange\CoreFramework\Handler\DataSet\HandleableDataSet;
}
// Return node data
- //* DEBUG-DIE: */ die(sprintf('[%s:%d]: nodeData=%s', __METHOD__, __LINE__, print_r($nodeData, TRUE)));
+ //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: nodeData=%s', __METHOD__, __LINE__, print_r($nodeData, TRUE)));
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-DHT-FACADE: nodeData()=%d - EXIT!', count($nodeData)));
return $nodeData;
}
public function findNodeByUniversalNodeLocator (LocateableNode $locatorInstance) {
// Default is empty data array
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-DHT-FACADE: locatorInstance=%s - CALLED!', $locatorInstance->__toString()));
- //* DEBUG-DIE: */ die(sprintf('[%s:%d]: locatorInstance=%s', __METHOD__, __LINE__, print_r($locatorInstance, TRUE)));
+ //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: locatorInstance=%s', __METHOD__, __LINE__, print_r($locatorInstance, TRUE)));
$nodeData = [];
// Query database
$resultInstance = $this->getFrontendInstance()->findNodeLocalByLocatorInstance($locatorInstance);
// Make sure the result instance is valid
- //* DEBUG-DIE: */ die(sprintf('[%s:%d]: resultInstance=%s', __METHOD__, __LINE__, print_r($resultInstance, TRUE)));
+ //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: resultInstance=%s', __METHOD__, __LINE__, print_r($resultInstance, TRUE)));
assert($resultInstance instanceof SearchableResult);
// Is the next entry valid?
}
// Return node data
- //* DEBUG-DIE: */ die(sprintf('[%s:%d]: nodeData=%s', __METHOD__, __LINE__, print_r($nodeData, TRUE)));
+ //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: nodeData=%s', __METHOD__, __LINE__, print_r($nodeData, TRUE)));
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-DHT-FACADE: nodeData()=%d - EXIT!', count($nodeData)));
return $nodeData;
}
use Org\Shipsimu\Hub\Tools\HubTools;
// Import framework stuff
+use Org\Mxchange\CoreFramework\EntryPoint\ApplicationEntryPoint;
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
use Org\Mxchange\CoreFramework\Generic\FrameworkException;
use Org\Mxchange\CoreFramework\Registry\Registerable;
}
// Get a protocol handler back from decoded data
- //* DEBUG-DIE: */ die(sprintf('[%s:%d]: packageInstance=%s', __METHOD__, __LINE__, print_r($packageInstance, TRUE)));
+ //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: packageInstance=%s', __METHOD__, __LINE__, print_r($packageInstance, TRUE)));
$handlerInstance = ProtocolHandlerFactory::createProtocolHandlerFromPackageInstance($packageInstance);
// Is the 'recipient' field same as this peer's IP?
// Import framework stuff
use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
+use Org\Mxchange\CoreFramework\EntryPoint\ApplicationEntryPoint;
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
use Org\Mxchange\CoreFramework\Socket\InvalidSocketException;
public static function createSocketFromPackageInstance (DeliverablePackage $packageInstance, HandleableProtocol $protocolInstance) {
// Init instance
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-FACTORY: packageInstance=%s,protocolInstance=%s - CALLED!', $packageInstance->__toString(), $protocolInstance->__toString()));
- //* DEBUG-DIE: */ die(sprintf('[%s:%d]: packageInstance=%s', __METHOD__, __LINE__, print_r($packageInstance, TRUE)));
+ //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: packageInstance=%s', __METHOD__, __LINE__, print_r($packageInstance, TRUE)));
$socketInstance = NULL;
// Construct registry key
// Import framework stuff
use Org\Mxchange\CoreFramework\Assertion\AssertionException;
+use Org\Mxchange\CoreFramework\EntryPoint\ApplicationEntryPoint;
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
use Org\Mxchange\CoreFramework\Registry\Registerable;
use Org\Mxchange\CoreFramework\Utils\String\StringUtils;
private function preparePackageAssmble () {
// Make sure both arrays have same count (this however should always be TRUE)
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CHUNK-HANDLER: CALLED!');
- //* DEBUG-DIE: */ die(sprintf('[%s:%d]: finalPackageChunks=%s', __METHOD__, __LINE__, print_r($this->finalPackageChunks['content'], TRUE)));
+ //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: finalPackageChunks=%s', __METHOD__, __LINE__, print_r($this->finalPackageChunks['content'], TRUE)));
assert(count($this->finalPackageChunks['hashes']) == count($this->finalPackageChunks['content']));
/*
// Import framework stuff
use Org\Mxchange\CoreFramework\Compressor\Compressor;
+use Org\Mxchange\CoreFramework\EntryPoint\ApplicationEntryPoint;
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
use Org\Mxchange\CoreFramework\Factory\Registry\Socket\SocketRegistryFactory;
use Org\Mxchange\CoreFramework\Feature\FrameworkFeature;
* Array indexes for raw package array
*/
const INDEX_PACKAGE_SENDER_ADDRESS = 0;
- const INDEX_PACKAGE_SENDER_PORT = 1;
- const INDEX_PACKAGE_RECIPIENT = 2;
- const INDEX_PACKAGE_CONTENT = 3;
- const INDEX_PACKAGE_STATUS = 4;
- const INDEX_PACKAGE_HASH = 5;
- const INDEX_PACKAGE_PRIVATE_KEY_HASH = 6;
+ const INDEX_PACKAGE_SENDER_ID = 1;
+ const INDEX_PACKAGE_SENDER_PORT = 2;
+ const INDEX_PACKAGE_RECIPIENT = 3;
+ const INDEX_PACKAGE_CONTENT = 4;
+ const INDEX_PACKAGE_STATUS = 5;
+ const INDEX_PACKAGE_HASH = 6;
+ const INDEX_PACKAGE_PRIVATE_KEY_HASH = 7;
/**
* Size of the decoded data array
*/
- const DECODED_DATA_ARRAY_SIZE = 7;
+ const DECODED_DATA_ARRAY_SIZE = 8;
/**
* Named array elements for decoded package content
/**
* Stacker name for new messages
*/
- const STACKER_NAME_NEW_MESSAGE = 'package_new_message';
+ const STACKER_NAME_NEW_MESSAGE = 'message_new';
/**
* Stacker name for processed messages
*/
- const STACKER_NAME_PROCESSED_MESSAGE = 'package_processed_message';
+ const STACKER_NAME_PROCESSED_MESSAGE = 'message_processed';
/**************************************************************************
* Stacker for raw data handling *
self::STACKER_NAME_DECODED_HANDLED,
self::STACKER_NAME_DECODED_CHUNKED,
self::STACKER_NAME_PACKAGE_DECOMPRESSED_XML,
+ self::STACKER_NAME_NEW_MESSAGE,
self::STACKER_NAME_PROCESSED_MESSAGE,
self::STACKER_NAME_OUTGOING_STREAM
), $forceReInit);
// Is an entry found?
/* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: senderData()=%d', count($senderData)));
- //* DEBUG-DIE: */ die(sprintf('[%s:%d]: senderData=%s', __METHOD__, __LINE__, print_r($senderData, TRUE)));
+ //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: senderData=%s', __METHOD__, __LINE__, print_r($senderData, TRUE)));
if (count($senderData) > 0 || !empty($senderData[NodeDistributedHashTableDatabaseFrontend::DB_COLUMN_PRIVATE_KEY_HASH])) {
// Return it
/* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: Returning senderData[%s]=%s', NodeDistributedHashTableDatabaseFrontend::DB_COLUMN_PRIVATE_KEY_HASH, $senderData[NodeDistributedHashTableDatabaseFrontend::DB_COLUMN_PRIVATE_KEY_HASH]));
public function getHashFromPackageSessionId (DeliverablePackage $packageInstance) {
// Is session id set?
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: packageInstance=%s - CALLED!', $packageInstance->__toString()));
- /* DEBUG-DIE: */ die(sprintf('[%s:%d]: packageInstance=%s', __METHOD__, __LINE__, print_r($packageInstance, TRUE)));
+ /* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: packageInstance=%s', __METHOD__, __LINE__, print_r($packageInstance, TRUE)));
if (empty($packageInstance->getSessionId())) {
// Throw exception
throw new InvalidArgumentException('packageInstance has no sessionId set.');
// Create the hash
// @TODO md5() is very weak, but it needs to be fast
$hash = md5(sprintf(self::CONTENT_CHECKSUM_MASK,
- $packageInstance->getRawXml(),
+ $packageInstance->getPackageContent(),
$packageInstance->getSessionId(),
$packageInstance->getCompressorExtension()
));
}
/**
- * Checks whether the hash of given package data is 'valid', here that
+ * Checks whether the hash of given package's raw XML is 'valid', here that
* means it is the same or not.
*
* @param $packageInstance An instance of a DeliverablePackage class
* @return $isHashValid Whether the hash is valid
*/
- private function isPackageHashValid (DeliverablePackage $packageInstance) {
+ private function isPackageContentHashValid (DeliverablePackage $packageInstance) {
// Is the feature enabled?
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: packageInstance=%s - CALLED!', $packageInstance->__toString()));
if (!FrameworkFeature::isFeatureAvailable('hubcoin_reward')) {
// Feature is not enabled, so hashes are always valid
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: Feature "hubcoin_reward" not available, not checking hash. Returning TRUE ...');
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: Feature "hubcoin_reward" not available, not checking hash. Returning TRUE ...');
return TRUE;
+ } elseif (empty($packageInstance->getSenderId())) {
+ // Empty sender id
+ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: packageInstance->senderId is empty', __METHOD__, __LINE__));
+ } elseif (empty($packageInstance->getPackageContent())) {
+ // Empty sender id
+ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: packageInstance->PackageContent is empty', __METHOD__, __LINE__));
}
// Check validity
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: packageInstance->senderId=%s,packageInstance->packageContent=%s,packageInstance->contentHash=%s', $packageInstance->getSenderId(), $packageInstance->getPackageContent(), $packageInstance->getContentHash()));
- $isHashValid = FrameworkFeature::callFeature('hubcoin_reward', 'checkHash', array(
+ //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: packageInstance=%s', __METHOD__, __LINE__, print_r($packageInstance, TRUE)));
+ $isHashValid = FrameworkFeature::callFeature('hubcoin_reward', 'checkHash', [
sprintf('%s:%s:%s',
$packageInstance->getSenderId(),
$packageInstance->getPackageContent(),
$this->determineSenderPrivateKeyHash($packageInstance)
),
$packageInstance->getContentHash(),
- ));
+ ]);
// Return it
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: isHashValid=%s - EXIT!', intval($isHashValid)));
// Assert on count (should be always 6)
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: decodedArray()=%d', count($decodedArray)));
- //* DEBUG-DIE: */ die(sprintf('[%s:%d]: decodedArray=%s', __METHOD__, __LINE__, print_r($decodedArray, TRUE)));
+ //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: decodedArray=%s', __METHOD__, __LINE__, print_r($decodedArray, TRUE)));
if (count($decodedArray) != self::DECODED_DATA_ARRAY_SIZE) {
// Count of array elements not expected
throw new InvalidArgumentException(sprintf('decodedArray()=%d does not match expected size %d. rawPackageContent=%s',
// Set all data
$packageInstance->setSenderAddress($decodedArray[self::INDEX_PACKAGE_SENDER_ADDRESS]);
+ $packageInstance->setSenderId($decodedArray[self::INDEX_PACKAGE_SENDER_ID]);
$packageInstance->setSenderPort($decodedArray[self::INDEX_PACKAGE_SENDER_PORT]);
$packageInstance->setRecipientId($decodedArray[self::INDEX_PACKAGE_RECIPIENT]);
$packageInstance->setRecipientType(self::RECIPIENT_TYPE_DIRECT);
// Copy data to package instance
$packageInstance->setCompressorExtension($decodedContent[self::INDEX_COMPRESSOR_EXTENSION]);
// Raw XML, being BASE64-decoded, still compressed
- $packageInstance->setRawXml(base64_decode($decodedContent[self::INDEX_PACKAGE_DATA]));
+ $packageInstance->setPackageContent(base64_decode($decodedContent[self::INDEX_PACKAGE_DATA]));
// Tags as an indexed array for "tagging" the message
$packageInstance->setContentTags(explode(self::PACKAGE_TAGS_SEPARATOR, $decodedContent[self::INDEX_TAGS]));
// Checksum of the _decoded_ data
$packageInstance->setContentChecksum($decodedContent[self::INDEX_CHECKSUM]);
// Decompress raw XML stream
- $packageInstance->setRawXml($this->getCompressorInstance()->decompressStream($packageInstance->getRawXml()));
+ $packageInstance->setPackageContent($this->getCompressorInstance()->decompressStream($packageInstance->getPackageContent()));
// And push it on the next stack
$this->getStackInstance()->pushNamed(self::STACKER_NAME_PACKAGE_DECOMPRESSED_XML, $packageInstance);
public function isNewMessageArrived () {
// Determine if the stack is not empty
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: CALLED!');
- $hasArrived = (!$this->getStackInstance()->isStackEmpty(self::STACKER_NAME_PACKAGE_DECOMPRESSED_XML));
+ $hasArrived = (!$this->getStackInstance()->isStackEmpty(self::STACKER_NAME_NEW_MESSAGE));
// Return it
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: hasArrived=%d - EXIT!', intval($hasArrived)));
$messageInstance = $this->getStackInstance()->popNamed(self::STACKER_NAME_NEW_MESSAGE);
// Generate the hash of comparing it
- /* DEBUG-DIE: */ die(sprintf('[%s:%d]: messageInstance=%s', __METHOD__, __LINE__, print_r($messageInstance, TRUE)));
+ /* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: messageInstance=%s', __METHOD__, __LINE__, print_r($messageInstance, TRUE)));
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: messageInstance=%s,senderId=%s,senderPrivateKeyHash=%s', $messageInstance->__toString(), $messageInstance->getSenderId(), $messageInstance->getSenderPrivateKeyHash()));
if (empty($messageInstance->getSenderId())) {
// Invalid $messageInstance
} elseif (empty($messageInstance->getSenderPrivateKeyHash())) {
// This needs fixing
throw new InvalidPrivateKeyHashException(array($this, $senderData, 'empty hash in decodedData'), BaseHubSystem::EXCEPTION_INVALID_PRIVATE_KEY_HASH);
- } elseif (!$this->isPackageHashValid($messageInstance)) {
+ } elseif (!$this->isMessageContentHashValid($messageInstance)) {
// Is not valid, so throw an exception here
- exit(__METHOD__ . ':INVALID HASH! UNDER CONSTRUCTION!' . PHP_EOL);
+ ApplicationEntryPoint::exitApplication(__METHOD__ . ':INVALID HASH! UNDER CONSTRUCTION!' . PHP_EOL);
}
// Now get a filter chain back from factory with given tags array
$packageInstance = $this->getStackInstance()->popNamed(self::STACKER_NAME_PACKAGE_DECOMPRESSED_XML);
// Generate the hash of comparing it
- /* DEBUG-DIE: */ die(sprintf('[%s:%d]: packageInstance=%s', __METHOD__, __LINE__, print_r($packageInstance, TRUE)));
+ //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: packageInstance=%s', __METHOD__, __LINE__, print_r($packageInstance, TRUE)));
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: packageInstance=%s,senderId=%s,senderPrivateKeyHash=%s', $packageInstance->__toString(), $packageInstance->getSenderId(), $packageInstance->getSenderPrivateKeyHash()));
if (empty($packageInstance->getSenderId())) {
// Invalid $packageInstance
} elseif (empty($packageInstance->getSenderPrivateKeyHash())) {
// This needs fixing
throw new InvalidPrivateKeyHashException(array($this, $senderData, 'empty hash in decodedData'), BaseHubSystem::EXCEPTION_INVALID_PRIVATE_KEY_HASH);
- } elseif (!$this->isPackageHashValid($packageInstance)) {
+ } elseif (!$this->isPackageContentHashValid($packageInstance)) {
// Is not valid, so throw an exception here
- exit(__METHOD__ . ':INVALID HASH! UNDER CONSTRUCTION!' . PHP_EOL);
+ ApplicationEntryPoint::exitApplication(__METHOD__ . ':INVALID HASH! UNDER CONSTRUCTION!' . PHP_EOL);
}
// Parse package's XML into a message instance
- /* DEBUG-DIE: */ die(sprintf('[%s:%d]: packageInstance=%s', __METHOD__, __LINE__, print_r($packageInstance, TRUE)));
+ /* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: packageInstance=%s', __METHOD__, __LINE__, print_r($packageInstance, TRUE)));
// Trace message
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE-HANDLER: EXIT!');
use Org\Shipsimu\Hub\Traits\Container\Socket\StorableSocketTrait;
// Import framework stuff
+use Org\Mxchange\CoreFramework\EntryPoint\ApplicationEntryPoint;
use Org\Mxchange\CoreFramework\Registry\Registerable;
use Org\Mxchange\CoreFramework\Socket\InvalidSocketException;
// Set socket here
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CONNECTION-INFO: Setting socketInstance=%s ...', $socketInstance->__toString()));
- //* DEBUG-DIE: */ die(sprintf('[%s:%d]: socketInstance=%s', __METHOD__, __LINE__, print_r($socketInstance, TRUE)));
+ //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: socketInstance=%s', __METHOD__, __LINE__, print_r($socketInstance, TRUE)));
$this->setSocketInstance($socketInstance);
// Trace message
use Org\Mxchange\CoreFramework\Criteria\Local\LocalSearchCriteria;
use Org\Mxchange\CoreFramework\Criteria\Storing\StoreableCriteria;
use Org\Mxchange\CoreFramework\Database\Updateable;
+use Org\Mxchange\CoreFramework\EntryPoint\ApplicationEntryPoint;
use Org\Mxchange\CoreFramework\Factory\Database\Frontend\DatabaseFrontendFactory;
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
use Org\Mxchange\CoreFramework\Generic\NullPointerException;
} // END - if
// Debugging:
- //* DEBUG-DIE: */ die(sprintf('[%s:%d]: nodeData=%s', __METHOD__, __LINE__, print_r($nodeData, TRUE)));
+ //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: nodeData=%s', __METHOD__, __LINE__, print_r($nodeData, TRUE)));
// Return it
return $nodeData;
use Org\Shipsimu\Hub\Generic\BaseHubSystem;
// Import framework stuff
+use Org\Mxchange\CoreFramework\EntryPoint\ApplicationEntryPoint;
use Org\Mxchange\CoreFramework\Registry\Registerable;
// Import SPL stuff
*/
private $contentHash;
- /**
- * Content message
- */
- private $rawXml;
-
/**
* Content checksum
*/
$this->contentTags = $contentTags;
}
- /**
- * Getter for content message
- *
- * @return $rawXml Content message
- */
- public final function getRawXml () {
- return $this->rawXml;
- }
-
- /**
- * Setter for content message
- *
- * @param $rawXml Content message
- * @return void
- */
- public final function setRawXml (string $rawXml) {
- $this->rawXml = $rawXml;
- }
-
/**
* Getter for content checksum
*
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('PACKAGE-DATA: properties()=%d', count($properties)));
foreach ($properties as $propertyInstance) {
// Is the declaring class this one?
- //* DEBUG-DIE: */ die(sprintf('[%s:%d] propertyInstance=%s', __METHOD__, __LINE__, print_r($propertyInstance)));
+ //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d] propertyInstance=%s', __METHOD__, __LINE__, print_r($propertyInstance)));
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('PACKAGE-DATA: propertyInstance->declaringClass->name=%s', $propertyInstance->getDeclaringClass()->getName()));
if ($propertyInstance->getDeclaringClass()->getName() !== $this->__toString()) {
// No, then skip this one
// Import framework stuff
use Org\Mxchange\CoreFramework\Assertion\AssertionException;
use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
+use Org\Mxchange\CoreFramework\EntryPoint\ApplicationEntryPoint;
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
use Org\Mxchange\CoreFramework\Registry\Registerable;
use Org\Mxchange\CoreFramework\Traits\Crypto\CryptoTrait;
if (!$this->isPackageProcessed($packageInstance)) {
// First put it the right way together again, implode on getAllAsArray() won't work!
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-FRAGMENTER: Package is not processed., getting all raw data ...');
- //* DEBUG-DIE: */ die(sprintf('[%s:%d]: packageInstance->allAsArray=%s', __METHOD__, __LINE__, print_r($packageInstance->getAllAsArray(), TRUE)));
- $rawData = sprintf('%s%s%d%s%s%s%s%s%s%s%s%s%s',
+ //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: packageInstance->allAsArray=%s', __METHOD__, __LINE__, print_r($packageInstance->getAllAsArray(), TRUE)));
+ $rawData = sprintf('%s%s%s%s%d%s%s%s%s%s%s%s%s%s%s',
$packageInstance->getSenderAddress(),
NetworkPackageHandler::PACKAGE_DATA_SEPARATOR,
+ $packageInstance->getSenderId(),
+ NetworkPackageHandler::PACKAGE_DATA_SEPARATOR,
$packageInstance->getSenderPort(),
NetworkPackageHandler::PACKAGE_DATA_SEPARATOR,
$packageInstance->getRecipientId(),
use Org\Shipsimu\Hub\Network\Recipient\Recipient;
// Import framework stuff
+use Org\Mxchange\CoreFramework\EntryPoint\ApplicationEntryPoint;
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
use Org\Mxchange\CoreFramework\Lists\Listable;
foreach ($recipients as $recipient) {
// These array elements must exist for this loop:
//* PRINTR-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('DHT-RECIPIENT: recipient=%s', print_r($recipient, TRUE)));
- //* DEBUG-DIE: */ die(sprintf('[%s:%d]: recipient=%s', __METHOD__, __LINE__, print_r($recipient, TRUE)));
+ //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: recipient=%s', __METHOD__, __LINE__, print_r($recipient, TRUE)));
if (empty($recipient[NodeDistributedHashTableDatabaseFrontend::DB_COLUMN_EXTERNAL_ADDRESS])) {
// External UNL needs to be set
throw new LogicException(sprintf('recipient[%s] is not set', NodeDistributedHashTableDatabaseFrontend::DB_COLUMN_EXTERNAL_ADDRESS));
use Org\Shipsimu\Hub\Registry\Socket\RegisterableSocket;
// Import framework stuff
+use Org\Mxchange\CoreFramework\EntryPoint\ApplicationEntryPoint;
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
use Org\Mxchange\CoreFramework\Registry\BaseRegistry;
public function isIncomingSocketRegistered (Listenable $listenerInstance) {
// Default is not found
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: listenerInstance=%s (protocol: %s) - CALLED!', $listenerInstance->__toString(), strtoupper($listenerInstance->getProtocolName())));
- //* DEBUG-DIE: */ die(sprintf('[%s:%d]: this=%s', __METHOD__, __LINE__, print_r($this, TRUE)));
+ //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: this=%s', __METHOD__, __LINE__, print_r($this, TRUE)));
$isRegistered = FALSE;
// Search listener's socket sub-registry
$registryInstance = $this->getInstance($listenerInstance->getProtocolName());
- //* DEBUG-DIE: */ die(sprintf('[%s:%d]: listenerInstance->protocolName=%s,registryInstance=%s', __METHOD__, __LINE__, $listenerInstance->getProtocolName(), print_r($registryInstance, TRUE)));
+ //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: listenerInstance->protocolName=%s,registryInstance=%s', __METHOD__, __LINE__, $listenerInstance->getProtocolName(), print_r($registryInstance, TRUE)));
// Get all sockets from it
foreach ($registryInstance->getInstanceRegistry() as $instanceKey => $socketInstance) {
// Is this socket as requested?
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: instanceKey=%s,socketInstance=%s,socketType=%s', $instanceKey, $socketInstance->__toString(), $socketInstance->getSocketType()));
- //* DEBUG-DIE: */ die(sprintf('[%s:%d]: socketInstance=%s', __METHOD__, __LINE__, print_r($socketInstance, TRUE)));
+ //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: socketInstance=%s', __METHOD__, __LINE__, print_r($socketInstance, TRUE)));
if ($socketInstance->getSocketType() == StorableSocket::CONNECTION_TYPE_INCOMING) {
// Is found!
$isRegistered = TRUE;
use Org\Shipsimu\Hub\Template\Engine\Xml\ObjectRegistry\XmlObjectRegistryTemplateEngine;
// Import framework stuff
+use Org\Mxchange\CoreFramework\EntryPoint\ApplicationEntryPoint;
use Org\Mxchange\CoreFramework\Factory\Template\XmlTemplateEngineFactory;
use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
$contentData = explode(NetworkPackageHandler::PACKAGE_MASK_SEPARATOR, $packageInstance->getPackageContent());
// Get the tags and store them locally
- //* DEBUG-DIE: */ die(sprintf('[%s:%d]: contentData(%d)=%s', __METHOD__, __LINE__, count($contentData), print_r($contentData, TRUE)));
+ //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: contentData(%d)=%s', __METHOD__, __LINE__, count($contentData), print_r($contentData, TRUE)));
$this->setTags(explode(NetworkPackageHandler::PACKAGE_TAGS_SEPARATOR, $contentData[NetworkPackageHandler::INDEX_TAGS]));
}
* the entry is invalid.
*/
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('PACKAGE-TAGS: entry[]=%s', gettype($entry)));
- //* DEBUG-DIE: */ die(sprintf('[%s:%d] entry=%s', __METHOD__, __LINE__, print_r($entry, TRUE)));
+ //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d] entry=%s', __METHOD__, __LINE__, print_r($entry, TRUE)));
if ((!is_array($entry)) || (count($entry) == 0) || (!isset($entry[XmlObjectRegistryTemplateEngine::OBJECT_TYPE_DATA_PROTOCOL])) || (!isset($entry[XmlObjectRegistryTemplateEngine::OBJECT_TYPE_DATA_RECIPIENT_TYPE]))) {
// Invalid entry found
throw new InvalidTagException(array($this, $tag), self::EXCEPTION_INVALID_TAG);
// Import framework stuff
use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
+use Org\Mxchange\CoreFramework\EntryPoint\ApplicationEntryPoint;
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
// Import SPL stuff
$recipientData = DhtObjectFactory::createDhtInstance('node')->findNodeByUniversalNodeLocator($locatorInstance);
// Init variable
- //* DEBUG-DIE: */ die(sprintf('[%s:%d]: recipientData=%s', __METHOD__, __LINE__, print_r($recipientData, TRUE)));
+ //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: recipientData=%s', __METHOD__, __LINE__, print_r($recipientData, TRUE)));
$sessionId = NULL;
// Is an entry found?
*/
function setContentTags (array $contentTags);
- /**
- * Getter for content message
- *
- * @return $rawXml Content message
- */
- function getRawXml ();
-
- /**
- * Setter for content message
- *
- * @param $rawXml Content message
- * @return void
- */
- function setRawXml (string $rawXml);
-
/**
* Getter for content checksum
*
-Subproject commit 57b4b400d2e4a35f92d83270477157df4ee7c2c4
+Subproject commit c30da7e118a91b814adb6e997a1e4a39d0f1cba4