From 0c954191a90e270541250b2b20125adcec6d61ac Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 3 Dec 2020 08:49:01 +0100 Subject: [PATCH] Continued: - when socket_listen() is left alone with default (0) value for the $backlog parameter and you have SYN cookies disabled in kernel, you will later get "Resource temporary unvailable" (code 11) - this can be only fixed by setting high enough values in config-local.php (not config.php) which depends on your used operanting system. - commented out noisy debug lines - converted old array() style to "new" [] way MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../socket/class_SocketContainer.php | 34 ++++++++++--------- .../class_PackageRecipientDiscovery.php | 9 ++--- .../handler/class_ProtocolHandlerFactory.php | 8 +---- .../package/class_NetworkPackageHandler.php | 2 +- .../ipv4/tcp/class_TcpProtocolHandler.php | 3 +- .../raw_data/tcp/class_TcpRawDataHandler.php | 2 +- .../raw_data/udp/class_UdpRawDataHandler.php | 4 +-- .../helper/class_BaseHubSystemHelper.php | 4 +-- .../connection/class_BaseConnectionHelper.php | 1 - .../listener/tcp/class_TcpListener.php | 2 +- .../tcp/class_TcpProtocolResolver.php | 3 +- .../class_ConnectionStatisticsHelper.php | 17 +++++----- application/hub/config.php | 6 ++++ .../hub/interfaces/class_HubInterface.php | 3 -- 14 files changed, 50 insertions(+), 48 deletions(-) diff --git a/application/hub/classes/container/socket/class_SocketContainer.php b/application/hub/classes/container/socket/class_SocketContainer.php index b9601bd6f..af36ce2d1 100644 --- a/application/hub/classes/container/socket/class_SocketContainer.php +++ b/application/hub/classes/container/socket/class_SocketContainer.php @@ -337,7 +337,7 @@ class SocketContainer extends BaseHubContainer implements StorableSocket, Visita */ public function getSocketRecipientUnl () { // Should be valid socket - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource())); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource())); if (!$this->isValidSocket()) { // Throw exception throw new InvalidSocketException(array($this), self::EXCEPTION_INVALID_SOCKET); @@ -347,7 +347,7 @@ class SocketContainer extends BaseHubContainer implements StorableSocket, Visita $packageInstance = $this->getPackageDataInstance(); // Return it - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: packageInstance.recipient=%s - EXIT!', strtoupper($this->getSocketProtocol()), $packageInstance->getRecipientUnl())); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: packageInstance.recipient=%s - EXIT!', strtoupper($this->getSocketProtocol()), $packageInstance->getRecipientUnl())); return $packageInstance->getRecipientUnl(); } @@ -359,23 +359,24 @@ class SocketContainer extends BaseHubContainer implements StorableSocket, Visita */ public function getSocketRecipientAddress () { // Should be valid socket - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource())); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource())); if (!$this->isValidSocket()) { // Throw exception throw new InvalidSocketException(array($this), self::EXCEPTION_INVALID_SOCKET); } // Get recipient - $recipient = $this->getSocketRecipientUnl(); + $recipientUnl = $this->getSocketRecipientUnl(); // Generate UNL instance for it - $locatorInstance = UniversalNodeLocatorFactory::createUnlInstanceFromString($recipient); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: recipientUnl=%s', strtoupper($this->getSocketProtocol()), $recipientUnl)); + $locatorInstance = UniversalNodeLocatorFactory::createUnlInstanceFromString($recipientUnl); // Get address part $recipientAddress = $locatorInstance->getUnlAddress(); // Return it - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: recipientAddress=%s - EXIT!', strtoupper($this->getSocketProtocol()), $recipientAddress)); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: recipientAddress=%s - EXIT!', strtoupper($this->getSocketProtocol()), $recipientAddress)); return $recipientAddress; } @@ -387,23 +388,24 @@ class SocketContainer extends BaseHubContainer implements StorableSocket, Visita */ public function getSocketRecipientPort () { // Should be valid socket - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource())); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource())); if (!$this->isValidSocket()) { // Throw exception throw new InvalidSocketException(array($this), self::EXCEPTION_INVALID_SOCKET); } - // Get recipient - $recipient = $this->getSocketRecipientUnl(); + // Get recipient UNL + $recipientUnl = $this->getSocketRecipientUnl(); // Generate UNL instance for it - $locatorInstance = UniversalNodeLocatorFactory::createUnlInstanceFromString($recipient); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: recipientUnl=%s', strtoupper($this->getSocketProtocol()), $recipientUnl)); + $locatorInstance = UniversalNodeLocatorFactory::createUnlInstanceFromString($recipientUnl); // Get port part $recipientPort = $locatorInstance->getUnlPort(); // Return it - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: recipientPort=%d - EXIT!', strtoupper($this->getSocketProtocol()), intval($recipientPort))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: recipientPort=%d - EXIT!', strtoupper($this->getSocketProtocol()), intval($recipientPort))); return $recipientPort; } @@ -414,12 +416,12 @@ class SocketContainer extends BaseHubContainer implements StorableSocket, Visita */ public function isValidSocket () { // Is it valid? - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource())); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource())); // @TODO maybe add more checks? is_resource() is still to less $isValidSocket = (is_resource($this->getSocketResource())); // Return status - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: isValidSocket=%d - EXIT!', strtoupper($this->getSocketProtocol()), intval($isValidSocket))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: isValidSocket=%d - EXIT!', strtoupper($this->getSocketProtocol()), intval($isValidSocket))); return $isValidSocket; } @@ -431,7 +433,7 @@ class SocketContainer extends BaseHubContainer implements StorableSocket, Visita */ public function getLastSocketErrorCode () { // Should be valid socket - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource())); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: this->socketResource=%s - CALLED!', strtoupper($this->getSocketProtocol()), $this->getSocketResource())); if (!$this->isValidSocket()) { // Throw exception throw new InvalidSocketException(array($this), self::EXCEPTION_INVALID_SOCKET); @@ -441,7 +443,7 @@ class SocketContainer extends BaseHubContainer implements StorableSocket, Visita $errorCode = socket_last_error($this->getSocketResource()); // Return it - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: errorCode=%d - EXIT!', strtoupper($this->getSocketProtocol()), intval($errorCode))); + //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: errorCode=%d - EXIT!', strtoupper($this->getSocketProtocol()), intval($errorCode))); return $errorCode; } @@ -561,7 +563,7 @@ class SocketContainer extends BaseHubContainer implements StorableSocket, Visita } // Try to listen on socket - $result = socket_listen($this->getSocketResource()); + $result = socket_listen($this->getSocketResource(), FrameworkBootstrap::getConfigurationInstance()->getConfigEntry(sprintf('%s_socket_listen_backlog', $this->getSocketProtocol()))); // Return result /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-SOCKET: result[%s]=%d,errorCode=%s - EXIT!', strtoupper($this->getSocketProtocol()), gettype($result), intval($result), $this->getLastSocketErrorCode())); diff --git a/application/hub/classes/discovery/recipient/package/class_PackageRecipientDiscovery.php b/application/hub/classes/discovery/recipient/package/class_PackageRecipientDiscovery.php index 3e993829d..cb534fdcb 100644 --- a/application/hub/classes/discovery/recipient/package/class_PackageRecipientDiscovery.php +++ b/application/hub/classes/discovery/recipient/package/class_PackageRecipientDiscovery.php @@ -111,10 +111,11 @@ class PackageRecipientDiscovery extends BaseRecipientDiscovery implements Discov $this->clearRecipients(); // Is the UNL empty but id given? - if (empty($packageInstance->getRecipientUnl()) && empty($packageInstance->getRecipientId())) { - // Uh, both is empty! - throw new InvalidArgumentException('packageInstance has both recipientUnl and recipientId empty.'); - } elseif (empty($packageInstance->getRecipientUnl()) && !empty($packageInstance->getRecipientId())) { + //* DEBUG-DIE: */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: packageInstance=%s', __METHOD__, __LINE__, print_r($packageInstance, TRUE))); + if (empty($packageInstance->getRecipientUnl()) && (empty($packageInstance->getRecipientId()) || $packageInstance->getRecipientId() == 'invalid')) { + // Uh, both is empty or invalid! + throw new InvalidArgumentException('packageInstance has both recipientUnl and recipientId empty or invalid.'); + } elseif (empty($packageInstance->getRecipientUnl()) && $packageInstance->getRecipientId() != 'invalid') { // Id is set, this might be resolved to an UNL /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('RECIPIENT-DISCOVERY: Resolving recipientId=%s to UNL ...', $packageInstance->getRecipientId())); $recipientUnl = HubTools::resolveSessionIdToUnl($packageInstance->getRecipientId()); diff --git a/application/hub/classes/factories/handler/class_ProtocolHandlerFactory.php b/application/hub/classes/factories/handler/class_ProtocolHandlerFactory.php index ddef8fc06..bfbb0ef74 100644 --- a/application/hub/classes/factories/handler/class_ProtocolHandlerFactory.php +++ b/application/hub/classes/factories/handler/class_ProtocolHandlerFactory.php @@ -55,13 +55,7 @@ class ProtocolHandlerFactory extends ObjectFactory { * @return $handlerInstance A protocol handler instance * @throws InvalidArgumentException If protocolType is not valid */ - private static function createProtocolHandlerByType ($protocolType) { - // Is it valid? - if (empty($protocolType)) { - // Throw excption - throw new InvalidArgumentException('protocolType is empty'); - } - + private static function createProtocolHandlerByType (string $protocolType) { // Do we have an instance in the registry? if (GenericRegistry::getRegistry()->instanceExists($protocolType . '_protocol_handler')) { // Then use this instance diff --git a/application/hub/classes/handler/package/class_NetworkPackageHandler.php b/application/hub/classes/handler/package/class_NetworkPackageHandler.php index b94154cb1..d10df7a57 100644 --- a/application/hub/classes/handler/package/class_NetworkPackageHandler.php +++ b/application/hub/classes/handler/package/class_NetworkPackageHandler.php @@ -1058,7 +1058,7 @@ class NetworkPackageHandler extends BaseHubHandler implements Deliverable, Recei // The UNL should be set but not recipientId /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: recipientUnl(%d)=%s,recipientId(%d)=%s', strlen($packageInstance->getRecipientUnl()), $packageInstance->getRecipientUnl(), strlen($packageInstance->getRecipientId()), $packageInstance->getRecipientId())); - if (!empty($packageInstance->getRecipientUnl()) && empty($packageInstance->getRecipientId())) { + if (!empty($packageInstance->getRecipientUnl()) && (empty($packageInstance->getRecipientId()) || $packageInstance->getRecipientId() == 'invalid')) { // Need to resolve UNL -> session id ("recipient id"), so prepare UNL instance /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NETWORK-PACKAGE-HANDLER: recipientUnl=%s is being solved into a session id ...', $packageInstance->getRecipientUnl())); $locatorInstance = UniversalNodeLocatorFactory::createUnlInstanceFromString($packageInstance->getRecipientUnl()); diff --git a/application/hub/classes/handler/protocol/ipv4/tcp/class_TcpProtocolHandler.php b/application/hub/classes/handler/protocol/ipv4/tcp/class_TcpProtocolHandler.php index 5f2cdce35..81c3c3921 100644 --- a/application/hub/classes/handler/protocol/ipv4/tcp/class_TcpProtocolHandler.php +++ b/application/hub/classes/handler/protocol/ipv4/tcp/class_TcpProtocolHandler.php @@ -3,6 +3,7 @@ namespace Org\Shipsimu\Hub\Handler\Protocol\Network\IpV4\Tcp; // Import application-specific stuff +use Org\Shipsimu\Hub\Container\Socket\StorableSocket; use Org\Shipsimu\Hub\Handler\Protocol\Network\IpV4\BaseIpV4ProtocolHandler; use Org\Shipsimu\Hub\Handler\Protocol\HandleableProtocol; @@ -43,7 +44,7 @@ class TcpProtocolHandler extends BaseIpV4ProtocolHandler implements HandleablePr // Set handler and protocol type $this->setHandlerName('tcp_protocol'); - $this->setProtocolName('tcp'); + $this->setProtocolName(StorableSocket::SOCKET_PROTOCOL_TCP); } /** diff --git a/application/hub/classes/handler/raw_data/tcp/class_TcpRawDataHandler.php b/application/hub/classes/handler/raw_data/tcp/class_TcpRawDataHandler.php index a2d61e6f7..773625ff7 100644 --- a/application/hub/classes/handler/raw_data/tcp/class_TcpRawDataHandler.php +++ b/application/hub/classes/handler/raw_data/tcp/class_TcpRawDataHandler.php @@ -82,7 +82,7 @@ class TcpRawDataHandler extends BaseRawDataHandler implements Networkable { $this->setErrorCode(StorableSocket::SOCKET_ERROR_UNHANDLED); // Read the raw data from socket in a loop - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('TCP-RAW-DATA-HANDLER: Handling TCP package from resource=%s,last error=%s,socketType=%s', $socketInstance->getSocketResource(), $socketInstance->getLastSocketErrorMessage(), $socketInstance->getSocketType())); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('TCP-RAW-DATA-HANDLER: Handling TCP package from socketResource=%s,last error=%s,socketType=%s', $socketInstance->getSocketResource(), $socketInstance->getLastSocketErrorMessage(), $socketInstance->getSocketType())); while ($rawData = $socketInstance->readDataFromSocket()) { // Get socket error code back /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('TCP-RAW-DATA-HANDLER: rawData(%d)[]=%s', strlen($rawData), gettype($rawData))); diff --git a/application/hub/classes/handler/raw_data/udp/class_UdpRawDataHandler.php b/application/hub/classes/handler/raw_data/udp/class_UdpRawDataHandler.php index e5908ea46..0edea1068 100644 --- a/application/hub/classes/handler/raw_data/udp/class_UdpRawDataHandler.php +++ b/application/hub/classes/handler/raw_data/udp/class_UdpRawDataHandler.php @@ -41,7 +41,7 @@ class UdpRawDataHandler extends BaseRawDataHandler implements Networkable { parent::__construct(__CLASS__); // Set handler name - $this->setHandlerName('udp'); + $this->setHandlerName(StorableSocket::SOCKET_PROTOCOL_UDP); } /** @@ -69,7 +69,7 @@ class UdpRawDataHandler extends BaseRawDataHandler implements Networkable { $this->setErrorCode(StorableSocket::SOCKET_ERROR_UNHANDLED); // Debug message - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('UDP-HANDLER: Handling UDP package from resource=' . $socketInstance->getSocketResource() . ',last error=' . $socketInstance->getLastSocketErrorMessage()); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('UDP-HANDLER: Handling UDP package from socketResource=%s,last error=%s', $socketInstance->getSocketResource(), $socketInstance->getLastSocketErrorMessage())); $this->partialStub('Please rewrite this part.'); return; } diff --git a/application/hub/classes/helper/class_BaseHubSystemHelper.php b/application/hub/classes/helper/class_BaseHubSystemHelper.php index 1c2ac60e2..6523d5c1e 100644 --- a/application/hub/classes/helper/class_BaseHubSystemHelper.php +++ b/application/hub/classes/helper/class_BaseHubSystemHelper.php @@ -65,7 +65,7 @@ abstract class BaseHubSystemHelper extends BaseHubSystem implements HubHelper { * * @return $recipientId Receipient id (mostly session id) */ - protected final function setRecipientId ($recipientId) { + protected final function setRecipientId (string $recipientId) { $this->recipientId = $recipientId; } @@ -83,7 +83,7 @@ abstract class BaseHubSystemHelper extends BaseHubSystem implements HubHelper { * * @return $recipientType Type of a recipient (the helper is made for) */ - protected final function setRecipientType ($recipientType) { + protected final function setRecipientType (string $recipientType) { $this->recipientType = $recipientType; } diff --git a/application/hub/classes/helper/connection/class_BaseConnectionHelper.php b/application/hub/classes/helper/connection/class_BaseConnectionHelper.php index 6c2bdc56f..e3ed55c08 100644 --- a/application/hub/classes/helper/connection/class_BaseConnectionHelper.php +++ b/application/hub/classes/helper/connection/class_BaseConnectionHelper.php @@ -3,7 +3,6 @@ namespace Org\Shipsimu\Hub\Helper\Connection; // Import application-specific stuff -use Org\Shipsimu\Hub\Container\Socket\StorableSocket; use Org\Shipsimu\Hub\Factory\Fragmenter\FragmenterFactory; use Org\Shipsimu\Hub\Factory\Handler\Network\NetworkPackageHandlerFactory; use Org\Shipsimu\Hub\Factory\Network\NetworkPackageFactory; diff --git a/application/hub/classes/listener/tcp/class_TcpListener.php b/application/hub/classes/listener/tcp/class_TcpListener.php index 88283c626..ee3ef1172 100644 --- a/application/hub/classes/listener/tcp/class_TcpListener.php +++ b/application/hub/classes/listener/tcp/class_TcpListener.php @@ -44,7 +44,7 @@ class TcpListener extends BaseListener implements Listenable { parent::__construct(__CLASS__); // Set the protocol to TCP - $this->setProtocolName('tcp'); + $this->setProtocolName(StorableSocket::SOCKET_PROTOCOL_TCP); } /** diff --git a/application/hub/classes/resolver/protocol/tcp/class_TcpProtocolResolver.php b/application/hub/classes/resolver/protocol/tcp/class_TcpProtocolResolver.php index 2867f4d5f..87fd7e207 100644 --- a/application/hub/classes/resolver/protocol/tcp/class_TcpProtocolResolver.php +++ b/application/hub/classes/resolver/protocol/tcp/class_TcpProtocolResolver.php @@ -3,6 +3,7 @@ namespace Org\Shipsimu\Hub\Resolver\Protocol\Tcp; // Import application-specific stuff +use Org\Shipsimu\Hub\Container\Socket\StorableSocket; use Org\Shipsimu\Hub\Database\Frontend\Node\Information\NodeInformationDatabaseFrontend; use Org\Shipsimu\Hub\Factory\Network\Locator\UniversalNodeLocatorFactory; use Org\Shipsimu\Hub\Node\Node; @@ -49,7 +50,7 @@ class TcpProtocolResolver extends BaseProtocolResolver implements ProtocolResolv parent::__construct(__CLASS__); // Set protocol type - $this->setProtocolName('tcp'); + $this->setProtocolName(StorableSocket::SOCKET_PROTOCOL_TCP); } /** diff --git a/application/hub/classes/statistics/connection/class_ConnectionStatisticsHelper.php b/application/hub/classes/statistics/connection/class_ConnectionStatisticsHelper.php index fa48628e1..26516c804 100644 --- a/application/hub/classes/statistics/connection/class_ConnectionStatisticsHelper.php +++ b/application/hub/classes/statistics/connection/class_ConnectionStatisticsHelper.php @@ -3,6 +3,7 @@ namespace Org\Shipsimu\Hub\Helper\Connection; // Import application-specific stuff +use Org\Shipsimu\Hub\Container\Socket\StorableSocket; use Org\Shipsimu\Hub\Generic\BaseHubSystem; use Org\Shipsimu\Hub\Helper\Connection\ConnectionHelper; @@ -38,18 +39,18 @@ class ConnectionStatisticsHelper extends BaseHubSystem { * Statistics array * @TODO Add more protocols to use */ - private static $connectionStatistics = array( + private static $connectionStatistics = [ // Statistics for TCP connections - 'tcp' => array( + StorableSocket::SOCKET_PROTOCOL_TCP => [ // Tried TCP connection attempts - 'retry_count' => array(), - ), + 'retry_count' => [], + ], // Statistics for UDP connections - 'udp' => array( + StorableSocket::SOCKET_PROTOCOL_UDP => [ // Tried UDP connection attempts - 'retry_count' => array(), - ) - ); + 'retry_count' => [], + ] + ]; /** * Protected constructor diff --git a/application/hub/config.php b/application/hub/config.php index dde2e1d85..56d70f508 100644 --- a/application/hub/config.php +++ b/application/hub/config.php @@ -790,6 +790,12 @@ $cfg->setConfigEntry('tcp_socket_accept_wait_usec', 0); // CFG: TCP-SOCKET-ENABLE-REUSE-ADDRESS $cfg->setConfigEntry('tcp_socket_enable_reuse_address', true); +// CFG: FILE-SOCKET-LISTEN-BACKLOG +$cfg->setConfigEntry('file_socket_listen_backlog', 0); + +// CFG: TCP-SOCKET-LISTEN-BACKLOG +$cfg->setConfigEntry('tcp_socket_listen_backlog', 1000); + // CFG: NODE-STATE-CHECKED-PACKAGE-CLASS $cfg->setConfigEntry('node_state_checked_package_class', 'NewConnectionNodeState'); diff --git a/application/hub/interfaces/class_HubInterface.php b/application/hub/interfaces/class_HubInterface.php index e18dde28a..c7c3de271 100644 --- a/application/hub/interfaces/class_HubInterface.php +++ b/application/hub/interfaces/class_HubInterface.php @@ -2,9 +2,6 @@ // Own namespace namespace Org\Shipsimu\Hub\Generic; -// Import application-specific stuff -use Org\Shipsimu\Hub\Container\Socket\StorableSocket; - // Inport frameworks stuff use Org\Mxchange\CoreFramework\Generic\FrameworkInterface; -- 2.39.5