From e3a2393b25e0872fa55cbd664d8c5ba736d930dc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 4 Jul 2018 02:14:21 +0200 Subject: [PATCH] Continued: - commented out noisy debug lines - updated core MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../classes/listener/class_BaseListener.php | 38 +++++++++---------- .../listener/class_BaseListenerDecorator.php | 6 +-- .../registry/socket/class_SocketRegistry.php | 4 +- .../class_RawDataPoolMonitorVisitor.php | 10 ++--- core | 2 +- 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/application/hub/classes/listener/class_BaseListener.php b/application/hub/classes/listener/class_BaseListener.php index 23c282a45..b30a17c70 100644 --- a/application/hub/classes/listener/class_BaseListener.php +++ b/application/hub/classes/listener/class_BaseListener.php @@ -180,7 +180,7 @@ abstract class BaseListener extends BaseHubSystem implements Visitable { */ protected function registerServerSocketInstance (StorableSocket $socketInstance) { // Trace message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: socketInstance=%s - CALLED!', strtoupper($this->getProtocolName()), $socketInstance->__toString())); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: socketInstance=%s - CALLED!', strtoupper($this->getProtocolName()), $socketInstance->__toString())); // First check if it is valid if ($this->isServerSocketRegistered($socketInstance)) { @@ -204,13 +204,13 @@ abstract class BaseListener extends BaseHubSystem implements Visitable { $this->getRegistryInstance()->registerSocketInstance($infoInstance, $socketInstance); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: Setting socketInstance ... (socketResource=%s)', strtoupper($this->getProtocolName()), $socketInstance->getSocketResource())); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: Setting socketInstance ... (socketResource=%s)', strtoupper($this->getProtocolName()), $socketInstance->getSocketResource())); // And set it here $this->setSocketInstance($socketInstance); // Trace message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: EXIT!', strtoupper($this->getProtocolName()))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: EXIT!', strtoupper($this->getProtocolName()))); } /** @@ -222,13 +222,13 @@ abstract class BaseListener extends BaseHubSystem implements Visitable { */ protected function isServerSocketRegistered (StorableSocket $socketInstance) { // Trace message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: socketInstance=%s - CALLED!', strtoupper($this->getProtocolName()), $socketInstance->__toString())); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: socketInstance=%s - CALLED!', strtoupper($this->getProtocolName()), $socketInstance->__toString())); // Get a connection info instance $infoInstance = ConnectionInfoFactory::createConnectionInfoInstance($this->getProtocolName(), StorableSocket::CONNECTION_TYPE_SERVER); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: infoInstance[]=%s', strtoupper($this->getProtocolName()), gettype($infoInstance))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: infoInstance[]=%s', strtoupper($this->getProtocolName()), gettype($infoInstance))); // Is the instance set? if (!($infoInstance instanceof ShareableInfo)) { @@ -240,13 +240,13 @@ abstract class BaseListener extends BaseHubSystem implements Visitable { $infoInstance->fillWithListenerInformation($this); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: Checking socketInstance ... (socketResource=%s)', strtoupper($this->getProtocolName()), $socketInstance->getSocketResource())); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: Checking socketInstance ... (socketResource=%s)', strtoupper($this->getProtocolName()), $socketInstance->getSocketResource())); // Check it $isRegistered = $this->getRegistryInstance()->isSocketRegistered($infoInstance, $socketInstance); // Trace message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: isRegistered=%d - EXIT!', strtoupper($this->getProtocolName()), intval($isRegistered))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: isRegistered=%d - EXIT!', strtoupper($this->getProtocolName()), intval($isRegistered))); // Return result return $isRegistered; @@ -260,7 +260,7 @@ abstract class BaseListener extends BaseHubSystem implements Visitable { */ public function accept (Visitor $visitorInstance) { // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($this->getProtocolName()) . '-LISTENER: ' . $visitorInstance->__toString() . ' has visited ' . $this->__toString() . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($this->getProtocolName()) . '-LISTENER: ' . $visitorInstance->__toString() . ' has visited ' . $this->__toString() . ' - CALLED!'); // Visit this listener $visitorInstance->visitListener($this); @@ -272,7 +272,7 @@ abstract class BaseListener extends BaseHubSystem implements Visitable { } // END - if // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($this->getProtocolName()) . '-LISTENER: ' . $visitorInstance->__toString() . ' has visited ' . $this->__toString() . ' - EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($this->getProtocolName()) . '-LISTENER: ' . $visitorInstance->__toString() . ' has visited ' . $this->__toString() . ' - EXIT!'); } /** @@ -346,7 +346,7 @@ abstract class BaseListener extends BaseHubSystem implements Visitable { */ protected function doListenSocketSelect ($peerSuffix) { // Trace message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: peerSuffix=%s - CALLED!', strtoupper($this->getProtocolName()), $peerSuffix)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: peerSuffix=%s - CALLED!', strtoupper($this->getProtocolName()), $peerSuffix)); // Check on all instances assert($this->getPoolInstance() instanceof Poolable); @@ -356,19 +356,19 @@ abstract class BaseListener extends BaseHubSystem implements Visitable { $socketInstance = SocketFactory::createNextAcceptedSocketFromPool($this->getPoolInstance(), $this->getSocketInstance()); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: socketInstance[]=%s accepted.', strtoupper($this->getProtocolName()), gettype($socketInstance))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: socketInstance[]=%s accepted.', strtoupper($this->getProtocolName()), gettype($socketInstance))); // Is socket instance set? if (!($socketInstance instanceof StorableSocket)) { // Trace message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: No new connection on listener ... - EXIT!', strtoupper($this->getProtocolName()))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: No new connection on listener ... - EXIT!', strtoupper($this->getProtocolName()))); // Nothing has changed on the listener return; } // END - if // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: socketInstance.socketResource=%s accepted.', strtoupper($this->getProtocolName()), $socketInstance->getSocketResource())); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: socketInstance.socketResource=%s accepted.', strtoupper($this->getProtocolName()), $socketInstance->getSocketResource())); // Init peer address/port $peerAddress = '0.0.0.0'; @@ -387,7 +387,7 @@ abstract class BaseListener extends BaseHubSystem implements Visitable { $infoInstance = ConnectionInfoFactory::createConnectionInfoInstance($this->getProtocolName(), StorableSocket::CONNECTION_TYPE_INCOMING); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: infoInstance[]=%s', strtoupper($this->getProtocolName()), gettype($infoInstance))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: infoInstance[]=%s', strtoupper($this->getProtocolName()), gettype($infoInstance))); // Is the instance set? if (!($infoInstance instanceof ShareableInfo)) { @@ -413,13 +413,13 @@ abstract class BaseListener extends BaseHubSystem implements Visitable { $this->getRegistryInstance()->registerSocketInstance($infoInstance, $socketInstance, $packageData); // Trace message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: Calling this.handlerInstance.processRawDataFromSocketInstance(resource=%s) ...', strtoupper($this->getProtocolName()), $socketInstance->getSocketResource())); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: Calling this.handlerInstance.processRawDataFromSocketInstance(resource=%s) ...', strtoupper($this->getProtocolName()), $socketInstance->getSocketResource())); // Handle it here, if not main server socket $this->getHandlerInstance()->processRawDataFromSocketInstance($socketInstance); // Trace message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: EXIT!', strtoupper($this->getProtocolName()))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: EXIT!', strtoupper($this->getProtocolName()))); } /** @@ -430,7 +430,7 @@ abstract class BaseListener extends BaseHubSystem implements Visitable { */ public function ifListenerAcceptsPackageData (array $packageData) { // Trace message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: packageData()=%d - CALLED!', strtoupper($this->getProtocolName()), count($packageData))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: packageData()=%d - CALLED!', strtoupper($this->getProtocolName()), count($packageData))); // Check if same socket protocol $socketProtocol = $this->getSocketInstance()->getSocketProtocol(); @@ -442,13 +442,13 @@ abstract class BaseListener extends BaseHubSystem implements Visitable { $unlProtocol = $unlInstance->getUnlProtocol(); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: unlInstance.unlProtocol=%s,socketProtocol=%s', strtoupper($this->getProtocolName()), $unlProtocol, $socketProtocol)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: unlInstance.unlProtocol=%s,socketProtocol=%s', strtoupper($this->getProtocolName()), $unlProtocol, $socketProtocol)); // Is same protocol? $accepts = ($unlProtocol == $socketProtocol); // Trace message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: accepts=%d - EXIT!', strtoupper($this->getProtocolName()), $accepts)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-LISTENER: accepts=%d - EXIT!', strtoupper($this->getProtocolName()), $accepts)); // Return the result return $accepts; diff --git a/application/hub/classes/listener/class_BaseListenerDecorator.php b/application/hub/classes/listener/class_BaseListenerDecorator.php index 172b2baae..a554b9b79 100644 --- a/application/hub/classes/listener/class_BaseListenerDecorator.php +++ b/application/hub/classes/listener/class_BaseListenerDecorator.php @@ -98,19 +98,19 @@ abstract class BaseListenerDecorator extends BaseDecorator implements Visitable */ public function accept (Visitor $visitorInstance) { // Trace message - /* NOSY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('LISTENER-DECORATOR: visitorInstance=%s - CALLED!', $visitorInstance->__toString())); + //* NOSY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('LISTENER-DECORATOR: visitorInstance=%s - CALLED!', $visitorInstance->__toString())); // Visit this decorator $visitorInstance->visitDecorator($this); // Trace message - /* NOSY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('LISTENER-DECORATOR: Calling visitorInstance->visitListener(%s) ...', $this->getListenerInstance()->__toString())); + //* NOSY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('LISTENER-DECORATOR: Calling visitorInstance->visitListener(%s) ...', $this->getListenerInstance()->__toString())); // Visit the covered class $visitorInstance->visitListener($this->getListenerInstance()); // Trace message - /* NOSY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('LISTENER-DECORATOR: EXIT!'); + //* NOSY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('LISTENER-DECORATOR: EXIT!'); } /** diff --git a/application/hub/classes/registry/socket/class_SocketRegistry.php b/application/hub/classes/registry/socket/class_SocketRegistry.php index cc080909c..16eacf6ba 100644 --- a/application/hub/classes/registry/socket/class_SocketRegistry.php +++ b/application/hub/classes/registry/socket/class_SocketRegistry.php @@ -371,13 +371,13 @@ class SocketRegistry extends BaseRegistry implements Register, RegisterableSocke */ public function isIncomingSocketRegistered () { // Trace message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY: CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-REGISTRY: CALLED!'); // Default is not found $isRegistered = FALSE; // Trace message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: isRegistered=%d - EXIT!', intval($isRegistered))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('SOCKET-REGISTRY: isRegistered=%d - EXIT!', intval($isRegistered))); // Return status return $isRegistered; diff --git a/application/hub/classes/visitor/pool/monitor/class_RawDataPoolMonitorVisitor.php b/application/hub/classes/visitor/pool/monitor/class_RawDataPoolMonitorVisitor.php index ffc9f76a7..add784402 100644 --- a/application/hub/classes/visitor/pool/monitor/class_RawDataPoolMonitorVisitor.php +++ b/application/hub/classes/visitor/pool/monitor/class_RawDataPoolMonitorVisitor.php @@ -72,7 +72,7 @@ class RawDataPoolMonitorVisitor extends BaseVisitor implements PoolVisitor, List */ public function visitPool (Poolable $poolInstance) { // A pool doesn't normally have any raw data waiting - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('RAWDATA-MONITOR-VISITOR: poolInstance=' . $poolInstance->__toString() . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('RAWDATA-MONITOR-VISITOR: poolInstance=' . $poolInstance->__toString() . ' - CALLED!'); } /** @@ -83,7 +83,7 @@ class RawDataPoolMonitorVisitor extends BaseVisitor implements PoolVisitor, List */ public function visitListener (Listenable $listenerInstance) { // Trace message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('RAWDATA-MONITOR-VISITOR: listenerInstance=' . $listenerInstance->__toString() . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('RAWDATA-MONITOR-VISITOR: listenerInstance=' . $listenerInstance->__toString() . ' - CALLED!'); /* * The TCP/UDP listener have a socket registry instance set. These @@ -92,7 +92,7 @@ class RawDataPoolMonitorVisitor extends BaseVisitor implements PoolVisitor, List $listenerInstance->monitorIncomingRawData(); // Trace message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('RAWDATA-MONITOR-VISITOR: EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('RAWDATA-MONITOR-VISITOR: EXIT!'); } /** @@ -103,9 +103,9 @@ class RawDataPoolMonitorVisitor extends BaseVisitor implements PoolVisitor, List */ public function visitDecorator (BaseDecorator $decoratorInstance) { // Do monitor here - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('RAWDATA-MONITOR-VISITOR: Visiting decoratorInstance=' . $decoratorInstance->__toString() . ' - CALLED!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('RAWDATA-MONITOR-VISITOR: Visiting decoratorInstance=' . $decoratorInstance->__toString() . ' - CALLED!'); $decoratorInstance->monitorIncomingRawData(); - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('RAWDATA-MONITOR-VISITOR: EXIT!'); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('RAWDATA-MONITOR-VISITOR: EXIT!'); } } diff --git a/core b/core index 3509acc25..3191b3ee4 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 3509acc2599a67101b078129441c8125f93dfa1e +Subproject commit 3191b3ee467d8844ec574321291cfc6ddc34eb69 -- 2.39.5