From fd5f16553ae1a3a60984c2b5390ce48b20156c74 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 5 Jul 2018 23:46:14 +0200 Subject: [PATCH] Continued: - added missing getter for UNL protocol - ops, outgoing TCP/UDP/any connections should be set to 'outgoing', not 'server' - commented out/in debug lines MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../socket/class_SocketContainer.php | 22 ++++++---- .../socket/class_PackageSocketDiscovery.php | 3 +- .../class_UniversalNodeLocatorFactory.php | 4 +- .../factories/socket/class_SocketFactory.php | 11 +++-- .../connection/class_BaseConnectionHelper.php | 32 +++++++-------- .../ipv4/class_BaseIpV4ConnectionHelper.php | 16 +++++--- .../listener/class_BaseListenerDecorator.php | 41 +++++++++---------- .../class_SocketFileListenerDecorator.php | 5 ++- .../listener/tcp/class_TcpListener.php | 12 ------ .../class_ClientTcpListenerDecorator.php | 6 +-- .../class_HubTcpListenerDecorator.php | 6 +-- .../class_ClientUdpListenerDecorator.php | 6 +-- .../class_HubUdpListenerDecorator.php | 6 +-- .../locator/class_UniversalNodeLocator.php | 31 ++++++++++++-- .../classes/package/class_NetworkPackage.php | 25 +++++++---- .../locator/class_LocateableNode.php | 7 ++++ 16 files changed, 138 insertions(+), 95 deletions(-) diff --git a/application/hub/classes/container/socket/class_SocketContainer.php b/application/hub/classes/container/socket/class_SocketContainer.php index ada6d8e14..ec6dcd444 100644 --- a/application/hub/classes/container/socket/class_SocketContainer.php +++ b/application/hub/classes/container/socket/class_SocketContainer.php @@ -113,6 +113,9 @@ class SocketContainer extends BaseHubContainer implements StorableSocket, Visita // Get a new instance $socketInstance = new SocketContainer(); + // Trace message + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET: socketResource=%s,socketProtocol=%s,packageData[%s]=%s', $socketResource, $socketProtocol, StorableSocket::SOCKET_ARRAY_INDEX_TYPE, $packageData[StorableSocket::SOCKET_ARRAY_INDEX_TYPE])); + // Set protocol $socketInstance->setSocketProtocol($socketProtocol); @@ -973,7 +976,8 @@ class SocketContainer extends BaseHubContainer implements StorableSocket, Visita */ public function writeBufferToSocketByArray (array &$socketBuffer, &$sentBytes) { // Trace message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: socketBuffer()=%d,sentBytes=%d - CALLED!', strtoupper($this->getSocketProtocol()), count($socketBuffer), $sentBytes)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: socketBuffer()=%d,sentBytes=%d - CALLED!', strtoupper($this->getSocketProtocol()), count($socketBuffer), $sentBytes)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: socketBuffer=%s', strtoupper($this->getSocketProtocol()), print_r($socketBuffer, TRUE))); // Should be valid socket if (!$this->isValidSocket()) { @@ -994,18 +998,18 @@ class SocketContainer extends BaseHubContainer implements StorableSocket, Visita } // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: Sending out %d bytes,rawBufferSize=%d,diff=%d to socketResource=%s', strtoupper($this->getSocketProtocol()), strlen($socketBuffer[NetworkPackage::RAW_INDEX_ENCODED_DATA]), $socketBuffer[NetworkPackage::RAW_INDEX_BUFFER_SIZE], $socketBuffer[NetworkPackage::RAW_INDEX_DIFF], $this->getSocketResource())); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: Sending out %d bytes,rawBufferSize=%d,diff=%d to socketResource=%s', strtoupper($this->getSocketProtocol()), strlen($socketBuffer[NetworkPackage::RAW_INDEX_ENCODED_DATA]), $socketBuffer[NetworkPackage::RAW_INDEX_BUFFER_SIZE], $socketBuffer[NetworkPackage::RAW_INDEX_DIFF], $this->getSocketResource())); // Is some data still pending or sent all out? if ($socketBuffer[NetworkPackage::RAW_INDEX_DIFF] >= 0) { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: MD5=%s', strtoupper($this->getSocketProtocol()), md5(substr($socketBuffer[NetworkPackage::RAW_INDEX_ENCODED_DATA], 0, ($socketBuffer[NetworkPackage::RAW_INDEX_BUFFER_SIZE] - $socketBuffer[NetworkPackage::RAW_INDEX_DIFF]))))); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: MD5=%s', strtoupper($this->getSocketProtocol()), md5(substr($socketBuffer[NetworkPackage::RAW_INDEX_ENCODED_DATA], 0, ($socketBuffer[NetworkPackage::RAW_INDEX_BUFFER_SIZE] - $socketBuffer[NetworkPackage::RAW_INDEX_DIFF]))))); // Send all out (encodedData is smaller than or equal buffer size) $sentBytes = socket_write($this->getSocketResource(), $socketBuffer[NetworkPackage::RAW_INDEX_ENCODED_DATA], ($socketBuffer[NetworkPackage::RAW_INDEX_BUFFER_SIZE] - $socketBuffer[NetworkPackage::RAW_INDEX_DIFF])); } else { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: MD5=%s', strtoupper($this->getSocketProtocol()), md5(substr($socketBuffer[NetworkPackage::RAW_INDEX_ENCODED_DATA], 0, $socketBuffer[NetworkPackage::RAW_INDEX_BUFFER_SIZE])))); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: MD5=%s', strtoupper($this->getSocketProtocol()), md5(substr($socketBuffer[NetworkPackage::RAW_INDEX_ENCODED_DATA], 0, $socketBuffer[NetworkPackage::RAW_INDEX_BUFFER_SIZE])))); // Send buffer size out $sentBytes = socket_write($this->getSocketResource(), $socketBuffer[NetworkPackage::RAW_INDEX_ENCODED_DATA], $socketBuffer[NetworkPackage::RAW_INDEX_BUFFER_SIZE]); @@ -1016,18 +1020,18 @@ class SocketContainer extends BaseHubContainer implements StorableSocket, Visita $result = ($sentBytes !== FALSE); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: sentBytes[%s]=%d,result=%d', strtoupper($this->getSocketProtocol()), gettype($sentBytes), $sentBytes, intval($result))); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: sentBytes[%s]=%d,result=%d', strtoupper($this->getSocketProtocol()), gettype($sentBytes), $sentBytes, intval($result))); // If there was an error, don't continue here if ($result === FALSE) { // Trace message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: socket_write() failed, please evalutate. - EXIT!', strtoupper($this->getSocketProtocol()))); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: socket_write() failed, please evalutate. - EXIT!', strtoupper($this->getSocketProtocol()))); // Failed delivery! return FALSE; } elseif (($sentBytes === 0) && (strlen($socketBuffer[NetworkPackage::RAW_INDEX_ENCODED_DATA]) > 0)) { // Trace message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: All sent, returning TRUE ... - EXIT!', strtoupper($this->getSocketProtocol()))); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: All sent, returning TRUE ... - EXIT!', strtoupper($this->getSocketProtocol()))); // Nothing sent means all data has been sent return TRUE; @@ -1039,7 +1043,7 @@ class SocketContainer extends BaseHubContainer implements StorableSocket, Visita $socketBuffer[NetworkPackage::RAW_INDEX_SENT_BYTES] += $sentBytes; // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: Sent out %d of %d bytes ...', strtoupper($this->getSocketProtocol()), $sentBytes, strlen($socketBuffer[NetworkPackage::RAW_INDEX_ENCODED_DATA]))); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: Sent out %d of %d bytes ...', strtoupper($this->getSocketProtocol()), $sentBytes, strlen($socketBuffer[NetworkPackage::RAW_INDEX_ENCODED_DATA]))); // Cut out the last unsent bytes $socketBuffer[NetworkPackage::RAW_INDEX_ENCODED_DATA] = substr($socketBuffer[NetworkPackage::RAW_INDEX_ENCODED_DATA], $sentBytes); @@ -1049,7 +1053,7 @@ class SocketContainer extends BaseHubContainer implements StorableSocket, Visita } // Trace message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: result=%d - EXIT!', strtoupper($this->getSocketProtocol()), intval($result))); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: result=%d - EXIT!', strtoupper($this->getSocketProtocol()), intval($result))); // Return result return $result; diff --git a/application/hub/classes/discovery/recipient/socket/class_PackageSocketDiscovery.php b/application/hub/classes/discovery/recipient/socket/class_PackageSocketDiscovery.php index 2bcfb5cd9..121419be7 100644 --- a/application/hub/classes/discovery/recipient/socket/class_PackageSocketDiscovery.php +++ b/application/hub/classes/discovery/recipient/socket/class_PackageSocketDiscovery.php @@ -151,7 +151,8 @@ class PackageSocketDiscovery extends BaseRecipientDiscovery implements Discovera */ public function discoverSocket (array $packageData, $connectionType) { // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-SOCKET-DISOVERY: connectionType=' . $connectionType . ' - CALLED!'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-SOCKET-DISOVERY: packageData()=' . count($packageData) . ',connectionType=' . $connectionType . ' - CALLED!'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('PACKAGE-SOCKET-DISOVERY: packageData=' . print_r($packageData, TRUE)); // Make sure all parameters are valid if (!isset($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT])) { diff --git a/application/hub/classes/factories/locator/class_UniversalNodeLocatorFactory.php b/application/hub/classes/factories/locator/class_UniversalNodeLocatorFactory.php index e58bb56f5..1508bf7e8 100644 --- a/application/hub/classes/factories/locator/class_UniversalNodeLocatorFactory.php +++ b/application/hub/classes/factories/locator/class_UniversalNodeLocatorFactory.php @@ -47,7 +47,7 @@ class UniversalNodeLocatorFactory extends ObjectFactory { */ public static final function createUnlInstanceFromString ($unl) { // Trace message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('UNL-FACTORY: unl=%s - CALLED!', $unl)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('UNL-FACTORY: unl=%s - CALLED!', $unl)); // If there is no handler? if (GenericRegistry::getRegistry()->instanceExists('unl_' . $unl)) { @@ -65,7 +65,7 @@ class UniversalNodeLocatorFactory extends ObjectFactory { } // Trace message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('UNL-FACTORY: unlInstance[]=%s - EXIT!', gettype($unlInstance))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('UNL-FACTORY: unlInstance[]=%s - EXIT!', gettype($unlInstance))); // Return the instance return $unlInstance; diff --git a/application/hub/classes/factories/socket/class_SocketFactory.php b/application/hub/classes/factories/socket/class_SocketFactory.php index d0d4a2f34..97ddddaf7 100644 --- a/application/hub/classes/factories/socket/class_SocketFactory.php +++ b/application/hub/classes/factories/socket/class_SocketFactory.php @@ -202,14 +202,17 @@ class SocketFactory extends ObjectFactory { * @todo Rewrite this to also handle IPv6 addresses and sockets */ public static final function createTcpOutgoingSocketFromPackageData (array $packageData) { + // Trace message + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-FACTORY: packageData=' . print_r($packageData, TRUE) . ' - CALLED!'); + // Create a socket instance $socketResource = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-FACTORY: Created socket[' . gettype($socketResource) . ']=' . $socketResource . '.'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-FACTORY: Created socket[' . gettype($socketResource) . ']=' . $socketResource . ' ...'); // Add socket type 'outgoing' to package data - $packageData[StorableSocket::SOCKET_ARRAY_INDEX_TYPE] = StorableSocket::CONNECTION_TYPE_SERVER; + $packageData[StorableSocket::SOCKET_ARRAY_INDEX_TYPE] = StorableSocket::CONNECTION_TYPE_OUTGOING; // Construct container class, this won't be reached if an exception is thrown $socketInstance = ObjectFactory::createObjectByConfiguredName('socket_container_class', array($socketResource, StorableSocket::SOCKET_PROTOCOL_TCP, $packageData)); @@ -231,7 +234,7 @@ class SocketFactory extends ObjectFactory { } // END - if // Set the option to reuse the port - self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-FACTORY: Enabling re-use address ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-FACTORY: Enabling re-use address ...'); if (!$socketInstance->enableSocketReuseAddress()) { // Handle this socket error with a faked recipientData array $socketInstance->handleSocketError(__METHOD__, __LINE__, array('0.0.0.0', '0')); @@ -242,7 +245,7 @@ class SocketFactory extends ObjectFactory { * it. This is now the default behaviour for all connection helpers who * call initConnection(); . */ - self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-FACTORY: Setting non-blocking mode.'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-FACTORY: Setting non-blocking mode.'); if (!$socketInstance->enableSocketNonBlocking()) { // Handle this socket error with a faked recipientData array $socketInstance->handleSocketError(__METHOD__, __LINE__, array('0.0.0.0', '0')); diff --git a/application/hub/classes/helper/connection/class_BaseConnectionHelper.php b/application/hub/classes/helper/connection/class_BaseConnectionHelper.php index 461624eef..2a75e3819 100644 --- a/application/hub/classes/helper/connection/class_BaseConnectionHelper.php +++ b/application/hub/classes/helper/connection/class_BaseConnectionHelper.php @@ -189,7 +189,7 @@ abstract class BaseConnectionHelper extends BaseHubSystemHelper implements Visit $rawDataChunk = $this->getFragmenterInstance()->getNextRawDataChunk($this->currentFinalHash); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: rawDataChunk=' . print_r($rawDataChunk, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: rawDataChunk=' . print_r($rawDataChunk, TRUE)); // Get chunk hashes and chunk data $chunkHashes = array_keys($rawDataChunk); @@ -199,19 +199,19 @@ abstract class BaseConnectionHelper extends BaseHubSystemHelper implements Visit $rawData = ''; // Is the required data there? - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: chunkHashes[]=' . count($chunkHashes) . ',chunkData[]=' . count($chunkData)); - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('chunkData='.print_r($chunkData, TRUE)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: chunkHashes[]=' . count($chunkHashes) . ',chunkData[]=' . count($chunkData)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('chunkData='.print_r($chunkData, TRUE)); if ((isset($chunkHashes[0])) && (isset($chunkData[0]))) { // Remember this chunk as queued $this->queuedChunks[$chunkHashes[0]] = $chunkData[0]; // Return the raw data - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: rawData()=' . strlen($chunkData[0]) . ' bytes.'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: rawData()=' . strlen($chunkData[0]) . ' bytes.'); $rawData = $chunkData[0]; } // END - if // Trace message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CONNECTION-HELPER: rawData()=%d - EXIT!', strlen($rawData))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CONNECTION-HELPER: rawData()=%d - EXIT!', strlen($rawData))); // Return raw data return $rawData; @@ -242,7 +242,7 @@ abstract class BaseConnectionHelper extends BaseHubSystemHelper implements Visit */ public function sendRawPackageData (array $packageData) { // Trace message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CONNECTION-HELPER: packageData()=%d - CALLED!', count($packageData))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CONNECTION-HELPER: packageData()=%d - CALLED!', count($packageData))); // The helper's state must be 'connected' $this->getStateInstance()->validatePeerStateConnected(); @@ -251,12 +251,12 @@ abstract class BaseConnectionHelper extends BaseHubSystemHelper implements Visit $finalHash = $this->getFragmenterInstance()->fragmentPackageArray($packageData, $this); // Trace message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CONNECTION-HELPER: finalHash[%s]=%s', gettype($finalHash), $finalHash)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CONNECTION-HELPER: finalHash[%s]=%s', gettype($finalHash), $finalHash)); // Is the final hash set? if ($finalHash !== TRUE) { // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: Setting finalHash=' . $finalHash . ',currentFinalHash[' . gettype($this->currentFinalHash) . ']=' . $this->currentFinalHash); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: Setting finalHash=' . $finalHash . ',currentFinalHash[' . gettype($this->currentFinalHash) . ']=' . $this->currentFinalHash); // Set final hash $this->currentFinalHash = $finalHash; @@ -272,32 +272,32 @@ abstract class BaseConnectionHelper extends BaseHubSystemHelper implements Visit // Fill sending buffer with data while (TRUE) { // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CONNECTION-HELPER: dataStream()=%d - BEFORE!', strlen($dataStream))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CONNECTION-HELPER: dataStream()=%d - BEFORE!', strlen($dataStream))); // Convert the package data array to a raw data stream $dataStream = $this->getRawDataFromPackageArray($packageData); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CONNECTION-HELPER: dataStream()=%d - AFTER!', strlen($dataStream))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CONNECTION-HELPER: dataStream()=%d - AFTER!', strlen($dataStream))); // Is it empty? if (strlen($dataStream) == 0) { // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: dataStream is now empty, exiting loop ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: dataStream is now empty, exiting loop ...'); // Abort here break; } // END - if // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: Adding ' . strlen($dataStream) . ' bytes to the sending buffer ...'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: Adding ' . strlen($dataStream) . ' bytes to the sending buffer ...'); // Add raw data $rawData .= $dataStream; } // END - while // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CONNECTION-HELPER: rawData()=%d - after loop ...', strlen($rawData))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CONNECTION-HELPER: rawData()=%d - after loop ...', strlen($rawData))); // Nothing to sent is bad news, so assert on it assert(strlen($rawData) > 0); @@ -306,13 +306,13 @@ abstract class BaseConnectionHelper extends BaseHubSystemHelper implements Visit $bufferSize = $this->getConfigInstance()->getConfigEntry($this->getProtocolName() . '_buffer_length'); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CONNECTION-HELPER: bufferSize=%d', $bufferSize)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CONNECTION-HELPER: bufferSize=%d', $bufferSize)); // Encode the raw data with our output-stream $encodedData = $this->getOutputStreamInstance()->streamData($rawData); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CONNECTION-HELPER: socketResource[%s]=%s', gettype($this->getSocketInstance()->getSocketResource()), $this->getSocketInstance()->getSocketResource())); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CONNECTION-HELPER: socketResource[%s]=%s', gettype($this->getSocketInstance()->getSocketResource()), $this->getSocketInstance()->getSocketResource())); // Init array $encodedDataArray = array( @@ -328,7 +328,7 @@ abstract class BaseConnectionHelper extends BaseHubSystemHelper implements Visit $this->getPackageInstance()->getStackInstance()->pushNamed(NetworkPackage::STACKER_NAME_OUTGOING_STREAM, $encodedDataArray); // Trace message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: EXIT!'); } /** diff --git a/application/hub/classes/helper/connection/ipv4/class_BaseIpV4ConnectionHelper.php b/application/hub/classes/helper/connection/ipv4/class_BaseIpV4ConnectionHelper.php index 479654a66..296b19a72 100644 --- a/application/hub/classes/helper/connection/ipv4/class_BaseIpV4ConnectionHelper.php +++ b/application/hub/classes/helper/connection/ipv4/class_BaseIpV4ConnectionHelper.php @@ -72,14 +72,14 @@ abstract class BaseIpV4ConnectionHelper extends BaseConnectionHelper { $socketError = $this->getSocketInstance()->getLastSocketErrorCode(); // Log error code and status - /* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: socketError=' . $socketError . ',isConnected=' . intval($isConnected)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: socketError=' . $socketError . ',isConnected=' . intval($isConnected)); // Skip any errors which may happen on non-blocking connections if (($socketError == SOCKET_EINPROGRESS) || ($socketError == SOCKET_EALREADY)) { // Now, is that attempt within parameters? if ((time() - $time) >= $timeout) { // Debug message - /* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: timeout=' . $timeout .' reached, connection attempt failed.'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: timeout=' . $timeout .' reached, connection attempt failed.'); // Didn't work within timeout $isConnected = FALSE; @@ -91,7 +91,7 @@ abstract class BaseIpV4ConnectionHelper extends BaseConnectionHelper { $this->idle(1000); } elseif ($socketError != 0) { // Debug message - /* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: socketError=' . $socketError . ' detected.'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: socketError=' . $socketError . ' detected.'); // Stop on everything else pronto $isConnected = FALSE; @@ -100,7 +100,7 @@ abstract class BaseIpV4ConnectionHelper extends BaseConnectionHelper { } // END - while // Log error code - /* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: socketError=' . $socketError . ',isConnected=' . intval($isConnected) . ',hasTimedOut=' . intval($hasTimedOut) . ' after while() loop.'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: socketError=' . $socketError . ',isConnected=' . intval($isConnected) . ',hasTimedOut=' . intval($hasTimedOut) . ' after while() loop.'); /* * All IPv4-based connections are non-blocking used by this program or @@ -110,7 +110,7 @@ abstract class BaseIpV4ConnectionHelper extends BaseConnectionHelper { */ if (($hasTimedOut === FALSE) && ($socketError == SOCKET_EINPROGRESS)) { // Debug message - /* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: Clearing "operation in progress" as this is for 99.999% chance a non-blocking I/O operation.'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: Clearing "operation in progress" as this is for 99.999% chance a non-blocking I/O operation.'); // A "connection in progress" has not timed out. All fine. $isConnected = TRUE; @@ -119,6 +119,9 @@ abstract class BaseIpV4ConnectionHelper extends BaseConnectionHelper { $this->getSocketInstance()->clearLastSocketError(); } // END - if + // Log error code + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: socketError=' . $socketError . ',isConnected=' . intval($isConnected) . ',hasTimedOut=' . intval($hasTimedOut) . ' after while() loop.'); + // Is the peer connected? if ($isConnected === TRUE) { // Connection is fully established here, so change the state. @@ -131,6 +134,9 @@ abstract class BaseIpV4ConnectionHelper extends BaseConnectionHelper { PeerStateFactory::createPeerStateInstanceByName('problem', $this); } + // Log error code + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: isConnected=' . intval($isConnected) . ' - EXIT!'); + // Return status return $isConnected; } diff --git a/application/hub/classes/listener/class_BaseListenerDecorator.php b/application/hub/classes/listener/class_BaseListenerDecorator.php index a554b9b79..7731124a8 100644 --- a/application/hub/classes/listener/class_BaseListenerDecorator.php +++ b/application/hub/classes/listener/class_BaseListenerDecorator.php @@ -68,6 +68,26 @@ abstract class BaseListenerDecorator extends BaseDecorator implements Visitable parent::__construct($className); } + /** + * Setter for protocol name + * + * @param $protocolName Name of used protocol + * @return void + */ + protected final function setProtocolName ($protocolName) { + $this->protocolName = $protocolName; + } + + /** + * Setter for UNL instance + * + * @param $unlInstance An instance of a LocateableNode class + * @return void + */ + protected final function setUniversalNodeLocatorInstance (LocateableNode $unlInstance) { + throw new UnsupportedOperationException('This method should not be called.'); + } + /** * Getter for listen address * @@ -310,27 +330,6 @@ abstract class BaseListenerDecorator extends BaseDecorator implements Visitable return $this->protocolName; } - /** - * Setter for protocol name - * - * @param $protocolName Name of used protocol - * @return void - */ - protected final function setProtocolName ($protocolName) { - $this->protocolName = $protocolName; - } - - /** - * Setter for UNL instance - * - * @para $unlInstance An instance of a LocateableNode class - * @return void - * @throws UnsupportedOperationException If this method is called - */ - protected final function setUniversalNodeLocatorInstance (LocateableNode $unlInstance) { - throw new UnsupportedOperationException('This method should not be called.'); - } - /** * Getter for UNL instance * diff --git a/application/hub/classes/listener/socket/decorator/class_SocketFileListenerDecorator.php b/application/hub/classes/listener/socket/decorator/class_SocketFileListenerDecorator.php index 7a8472b59..1cde53c38 100644 --- a/application/hub/classes/listener/socket/decorator/class_SocketFileListenerDecorator.php +++ b/application/hub/classes/listener/socket/decorator/class_SocketFileListenerDecorator.php @@ -80,7 +80,7 @@ class SocketFileListenerDecorator extends BaseListenerDecorator implements Liste */ public function doListen () { // Trace message - /* NOSY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-FILE-LISTENER: Calling this->getListenerInstance() ...'); + /* NOSY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-FILE-LISTENER: Calling this->getListenerInstance()->doListen() ...'); // Handle generic TCP package $this->getListenerInstance()->doListen(); @@ -96,6 +96,9 @@ class SocketFileListenerDecorator extends BaseListenerDecorator implements Liste * @return $accepts Whether this listener does accept */ public function ifListenerAcceptsPackageData (array $packageData) { + // Debug message + /* NOSY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-FILE-LISTENER: Calling this->getListenerInstance()->ifListenerAcceptsPackageData() ...'); + // Call inner method, no decoration is wanted in this method return $this->getListenerInstance()->ifListenerAcceptsPackageData($packageData); } diff --git a/application/hub/classes/listener/tcp/class_TcpListener.php b/application/hub/classes/listener/tcp/class_TcpListener.php index b8cf929c9..617f95f2e 100644 --- a/application/hub/classes/listener/tcp/class_TcpListener.php +++ b/application/hub/classes/listener/tcp/class_TcpListener.php @@ -115,16 +115,4 @@ class TcpListener extends BaseListener implements Listenable { //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TCP-LISTENER: EXIT!'); } - /** - * Checks whether the listener would accept the given package data array - * - * @param $packageData Raw package data - * @return $accepts Whether this listener does accept - * @throws UnsupportedOperationException If this method is called - */ - public function ifListenerAcceptsPackageData (array $packageData) { - // Please don't call this - throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION); - } - } diff --git a/application/hub/classes/listener/tcp/decorators/class_ClientTcpListenerDecorator.php b/application/hub/classes/listener/tcp/decorators/class_ClientTcpListenerDecorator.php index d65a4daa6..b2b69ef6c 100644 --- a/application/hub/classes/listener/tcp/decorators/class_ClientTcpListenerDecorator.php +++ b/application/hub/classes/listener/tcp/decorators/class_ClientTcpListenerDecorator.php @@ -99,8 +99,8 @@ class ClientTcpListenerDecorator extends BaseListenerDecorator implements Listen // Trace message /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CLIENT-TCP-LISTENER: packageData()=%d - CALLED!', count($packageData))); - // Call parent method - if (!parent::ifListenerAcceptsPackageData($packageData)) { + // Invoke decorated listener's method + if (!$this->getListenerInstance()->ifListenerAcceptsPackageData($packageData)) { // Trace message /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-FILE-LISTENER: Protocol mismatching, not accepting package.'); @@ -109,7 +109,7 @@ class ClientTcpListenerDecorator extends BaseListenerDecorator implements Listen } // END - if // Debugging - /* DEBUG-DIE: */ die(__METHOD__.':packageData='.print_r($packageData, TRUE)); + /* DEBUG-DIE: */ die(__METHOD__ . ':packageData=' . print_r($packageData, TRUE)); // Get a tags instance $tagsInstance = PackageTagsFactory::createPackageTagsInstance(); diff --git a/application/hub/classes/listener/tcp/decorators/class_HubTcpListenerDecorator.php b/application/hub/classes/listener/tcp/decorators/class_HubTcpListenerDecorator.php index bcabb5fa1..73b4edc1e 100644 --- a/application/hub/classes/listener/tcp/decorators/class_HubTcpListenerDecorator.php +++ b/application/hub/classes/listener/tcp/decorators/class_HubTcpListenerDecorator.php @@ -99,8 +99,8 @@ class HubTcpListenerDecorator extends BaseListenerDecorator implements Listenabl // Trace message /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HUB-TCP-LISTENER: packageData()=%d - CALLED!', count($packageData))); - // Call parent method - if (!parent::ifListenerAcceptsPackageData($packageData)) { + // // Invoke decorated listener's method + if (!$this->getListenerInstance()->ifListenerAcceptsPackageData($packageData)) { // Trace message /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-FILE-LISTENER: Protocol mismatching, not accepting package.'); @@ -109,7 +109,7 @@ class HubTcpListenerDecorator extends BaseListenerDecorator implements Listenabl } // END - if // Debugging - /* DEBUG-DIE: */ die(__METHOD__.':packageData='.print_r($packageData, TRUE)); + //* DEBUG-DIE: */ die(__METHOD__ . ':packageData=' . print_r($packageData, TRUE)); // Get a tags instance $tagsInstance = PackageTagsFactory::createPackageTagsInstance(); diff --git a/application/hub/classes/listener/udp/decorators/class_ClientUdpListenerDecorator.php b/application/hub/classes/listener/udp/decorators/class_ClientUdpListenerDecorator.php index 1de47c55a..847a300a9 100644 --- a/application/hub/classes/listener/udp/decorators/class_ClientUdpListenerDecorator.php +++ b/application/hub/classes/listener/udp/decorators/class_ClientUdpListenerDecorator.php @@ -99,8 +99,8 @@ class ClientUdpListenerDecorator extends BaseListenerDecorator implements Listen // Trace message /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('CLIENT-UDP-LISTENER: packageData()=%d - CALLED!', count($packageData))); - // Call parent method - if (!parent::ifListenerAcceptsPackageData($packageData)) { + // Invoke decorated listener's method + if (!$this->getListenerInstance()->ifListenerAcceptsPackageData($packageData)) { // Trace message /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-FILE-LISTENER: Protocol mismatching, not accepting package.'); @@ -109,7 +109,7 @@ class ClientUdpListenerDecorator extends BaseListenerDecorator implements Listen } // END - if // Debugging - /* DEBUG-DIE: */ die(__METHOD__.':packageData='.print_r($packageData, TRUE)); + /* DEBUG-DIE: */ die(__METHOD__ . ':packageData=' . print_r($packageData, TRUE)); // Get a tags instance $tagsInstance = PackageTagsFactory::createPackageTagsInstance(); diff --git a/application/hub/classes/listener/udp/decorators/class_HubUdpListenerDecorator.php b/application/hub/classes/listener/udp/decorators/class_HubUdpListenerDecorator.php index 76d298450..325356036 100644 --- a/application/hub/classes/listener/udp/decorators/class_HubUdpListenerDecorator.php +++ b/application/hub/classes/listener/udp/decorators/class_HubUdpListenerDecorator.php @@ -99,8 +99,8 @@ class HubUdpListenerDecorator extends BaseListenerDecorator implements Listenabl // Trace message /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HUB-UDP-LISTENER: packageData()=%d - CALLED!', count($packageData))); - // Call parent method - if (!parent::ifListenerAcceptsPackageData($packageData)) { + // Invoke decorated listener's method + if ($this->getListenerInstance()->ifListenerAcceptsPackageData($packageData)) { // Trace message /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-FILE-LISTENER: Protocol mismatching, not accepting package.'); @@ -109,7 +109,7 @@ class HubUdpListenerDecorator extends BaseListenerDecorator implements Listenabl } // END - if // Debugging - /* DEBUG-DIE: */ die(__METHOD__.':packageData='.print_r($packageData, TRUE)); + /* DEBUG-DIE: */ die(__METHOD__ . ':packageData=' . print_r($packageData, TRUE)); // Get a tags instance $tagsInstance = PackageTagsFactory::createPackageTagsInstance(); diff --git a/application/hub/classes/locator/class_UniversalNodeLocator.php b/application/hub/classes/locator/class_UniversalNodeLocator.php index 23630f4fe..7a283e572 100644 --- a/application/hub/classes/locator/class_UniversalNodeLocator.php +++ b/application/hub/classes/locator/class_UniversalNodeLocator.php @@ -117,6 +117,28 @@ class UniversalNodeLocator extends BaseHubSystem implements LocateableNode, Regi return $unlData[NodeInformationDatabaseWrapper::DB_COLUMN_INTERNAL_UNL]; } + /** + * Some "getter" for UNL protocol part. + * + * @return $unlAddress UNL protocol part + */ + public function getUnlProtocol () { + // Get UNL data + $unlData = $this->getUnlData(); + + // Default value is NULL + $unkProtocol = NULL; + + // Is the element there? + if (isset($unlData[LocateableNode::UNL_PART_PROTOCOL])) { + // Use it + $unkProtocol = $unlData[LocateableNode::UNL_PART_PROTOCOL]; + } // END - if + + // Return it + return $unkProtocol; + } + /** * Some "getter" for UNL address part. * @@ -127,16 +149,16 @@ class UniversalNodeLocator extends BaseHubSystem implements LocateableNode, Regi $unlData = $this->getUnlData(); // Default value is NULL - $unlPort = NULL; + $unkAddress = NULL; // Is the element there? if (isset($unlData[LocateableNode::UNL_PART_ADDRESS])) { // Use it - $unlPort = $unlData[LocateableNode::UNL_PART_ADDRESS]; + $unkAddress = $unlData[LocateableNode::UNL_PART_ADDRESS]; } // END - if // Return it - return $unlPort; + return $unkAddress; } /** @@ -271,6 +293,9 @@ class UniversalNodeLocator extends BaseHubSystem implements LocateableNode, Regi // Is the key found? if (isset($unlData[$key])) { + // Debug message + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('UNIVERSAL-NODE-LOCATOR: Copying unlData[' . $key . ']=' . $unlData[$key] . ' ...'); + // The copy the entry $this->unlData[$key] = $unlData[$key]; } // END - if diff --git a/application/hub/classes/package/class_NetworkPackage.php b/application/hub/classes/package/class_NetworkPackage.php index c4ac7d04b..26063f589 100644 --- a/application/hub/classes/package/class_NetworkPackage.php +++ b/application/hub/classes/package/class_NetworkPackage.php @@ -1048,7 +1048,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R */ public function sendEncodedData () { // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE: CALLED!'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE: CALLED!'); // Make sure there is pending encoded data assert($this->isEncodedDataPending()); @@ -1064,37 +1064,44 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R assert($encodedDataArray[self::RAW_INDEX_SOCKET_INSTANCE] instanceof StorableSocket); assert($encodedDataArray[self::RAW_INDEX_SOCKET_INSTANCE]->isValidSocket()); + // Get socket instance and remove it from array + $socketInstance = $encodedDataArray[self::RAW_INDEX_SOCKET_INSTANCE]; + $encodedDataArray[self::RAW_INDEX_SOCKET_INSTANCE] = NULL; + // Trace message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE: Calling socketInstance->writeBufferToSocketByArray(%d,%d) ...', count($encodedDataArray), $sentBytes)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE: Calling socketInstance->writeBufferToSocketByArray(%d,%d) ...', count($encodedDataArray), $sentBytes)); // And deliver it - if (!$encodedDataArray[self::RAW_INDEX_SOCKET_INSTANCE]->writeBufferToSocketByArray($encodedDataArray, $sentBytes)) { + if (!$socketInstance->writeBufferToSocketByArray($encodedDataArray, $sentBytes)) { // Something bad happened while writing to socket - $encodedDataArray[self::RAW_INDEX_SOCKET_INSTANCE]->handleSocketError(__METHOD__, __LINE__, array('0.0.0.0', '0')); + $socketInstance->handleSocketError(__METHOD__, __LINE__, array('0.0.0.0', '0')); } // END - if // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE: sentBytes[%s]=%d', gettype($sentBytes), $sentBytes)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE: sentBytes[%s]=%d', gettype($sentBytes), $sentBytes)); // If there was an error, don't continue here if (($sentBytes === 0) && (strlen($encodedDataArray[self::RAW_INDEX_ENCODED_DATA]) > 0)) { // Nothing sent means all data has been sent - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: All sent! (LINE=' . __LINE__ . ')'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: All sent! (LINE=' . __LINE__ . ')'); return; } elseif (strlen($encodedDataArray[self::RAW_INDEX_ENCODED_DATA]) == 0) { // Abort here, all sent! - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: All sent! (LINE=' . __LINE__ . ')'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: All sent! (LINE=' . __LINE__ . ')'); return; } + // Set it back + $encodedDataArray[self::RAW_INDEX_SOCKET_INSTANCE] = $socketInstance; + // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: Pushing raw data back to stacker, as still some data is pending delivery.'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONNECTION-HELPER: Pushing raw data back to stacker, as still some data is pending delivery.'); // Push array back in stack $this->getStackInstance()->pushNamed(self::STACKER_NAME_OUTGOING_STREAM, $encodedDataArray); // Debug message - //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE: EXIT!'); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NETWORK-PACKAGE: EXIT!'); } /////////////////////////////////////////////////////////////////////////// diff --git a/application/hub/interfaces/locator/class_LocateableNode.php b/application/hub/interfaces/locator/class_LocateableNode.php index e65907fbb..b29ee82f4 100644 --- a/application/hub/interfaces/locator/class_LocateableNode.php +++ b/application/hub/interfaces/locator/class_LocateableNode.php @@ -59,6 +59,13 @@ interface LocateableNode extends HubInterface { */ function getInternalUnl (); + /** + * Some "getter" for UNL protocol + * + * @return $unlProtocol Protocol part of UNL + */ + function getUnlProtocol (); + /** * Some "getter" for UNL address. * -- 2.39.5