From 260fdd76abc92f702fdd1216ab675784a1784887 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Thu, 21 Jan 2016 19:22:20 +0100 Subject: [PATCH] Continued with rewrite: - moved 'pool' interfaces to 'core' as they are generic enough. - more rewrites (broken stuff) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../class_PeerStateLookupDatabaseWrapper.php | 2 +- .../handler/chunks/class_ChunkHandler.php | 5 +- .../ipv4/class_BaseIpV4ConnectionHelper.php | 16 ++--- .../ipv4/tcp/class_TcpConnectionHelper.php | 6 +- .../listener/tcp/class_TcpListener.php | 12 ++-- .../listener/udp/class_UdpListener.php | 8 +-- .../assembler/class_PackageAssembler.php | 5 +- .../classes/package/class_NetworkPackage.php | 12 +++- .../pools/peer/class_DefaultPeerPool.php | 6 +- .../state/peer/class_PeerStateResolver.php | 2 +- application/hub/interfaces/pool/.htaccess | 1 - .../hub/interfaces/pool/class_Poolable.php | 28 --------- .../hub/interfaces/pool/listener/.htaccess | 1 - .../pool/listener/class_PoolableListener.php | 35 ----------- .../hub/interfaces/pool/peer/.htaccess | 1 - .../pool/peer/class_PoolablePeer.php | 61 ------------------- 16 files changed, 43 insertions(+), 158 deletions(-) delete mode 100644 application/hub/interfaces/pool/.htaccess delete mode 100644 application/hub/interfaces/pool/class_Poolable.php delete mode 100644 application/hub/interfaces/pool/listener/.htaccess delete mode 100644 application/hub/interfaces/pool/listener/class_PoolableListener.php delete mode 100644 application/hub/interfaces/pool/peer/.htaccess delete mode 100644 application/hub/interfaces/pool/peer/class_PoolablePeer.php diff --git a/application/hub/classes/database/frontend/states/class_PeerStateLookupDatabaseWrapper.php b/application/hub/classes/database/frontend/states/class_PeerStateLookupDatabaseWrapper.php index 64d9f9df8..e147e1618 100644 --- a/application/hub/classes/database/frontend/states/class_PeerStateLookupDatabaseWrapper.php +++ b/application/hub/classes/database/frontend/states/class_PeerStateLookupDatabaseWrapper.php @@ -222,7 +222,7 @@ class PeerStateLookupDatabaseWrapper extends BaseDatabaseWrapper implements Look $lastError = socket_last_error($socketResource); // Doesn't work! - throw new InvalidSocketException(array($this, $socketResource, $lastError, socket_strerror($lastError)), BaseListener::EXCEPTION_INVALID_SOCKET); + throw new InvalidSocketException(array($this, $socketResource, $lastError, socket_strerror($lastError)), SocketHandler::EXCEPTION_INVALID_SOCKET); } // END - if // Debug message diff --git a/application/hub/classes/handler/chunks/class_ChunkHandler.php b/application/hub/classes/handler/chunks/class_ChunkHandler.php index 180805cdd..6054bde60 100644 --- a/application/hub/classes/handler/chunks/class_ChunkHandler.php +++ b/application/hub/classes/handler/chunks/class_ChunkHandler.php @@ -39,6 +39,9 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable const CHUNK_SPLITS_INDEX_SERIAL = 1; const CHUNK_SPLITS_INDEX_RAW_DATA = 2; + // Exception codes + const EXCEPTION_FINAL_CHUNK_VERIFICATION = 0xf3300; + /** * The final array for assembling the original package back together */ @@ -444,7 +447,7 @@ class ChunkHandler extends BaseHandler implements HandleableChunks, Registerable $this->isValidFinalChunk($chunks); } catch (AssertionException $e) { // Last chunk is not valid - throw new FinalChunkVerificationException(array($this, $chunks, $e), BaseListener::EXCEPTION_FINAL_CHUNK_VERIFICATION); + throw new FinalChunkVerificationException(array($this, $chunks, $e), self::EXCEPTION_FINAL_CHUNK_VERIFICATION); } // Do we have some pending chunks (no final)? diff --git a/application/hub/classes/helper/connection/ipv4/class_BaseIpV4ConnectionHelper.php b/application/hub/classes/helper/connection/ipv4/class_BaseIpV4ConnectionHelper.php index 895acb9ac..07f94a6e1 100644 --- a/application/hub/classes/helper/connection/ipv4/class_BaseIpV4ConnectionHelper.php +++ b/application/hub/classes/helper/connection/ipv4/class_BaseIpV4ConnectionHelper.php @@ -75,7 +75,7 @@ class BaseIpV4ConnectionHelper extends BaseConnectionHelper { // And throw again // @TODO Move this to the socket error handler - throw new SocketOptionException(array($this, $socketResource, $socketError, $errorMessage), BaseListener::EXCEPTION_INVALID_SOCKET); + throw new SocketOptionException(array($this, $socketResource, $socketError, $errorMessage), SocketHandler::EXCEPTION_INVALID_SOCKET); } // END - if /* @@ -88,7 +88,7 @@ class BaseIpV4ConnectionHelper extends BaseConnectionHelper { $helperInstance->handleSocketError(__METHOD__, __LINE__, $socketResource, array('0.0.0.0', '0')); // And throw again - throw new SocketOptionException(array($helperInstance, $socketResource, $socketError, $errorMessage), BaseListener::EXCEPTION_INVALID_SOCKET); + throw new SocketOptionException(array($helperInstance, $socketResource, $socketError, $errorMessage), SocketHandler::EXCEPTION_INVALID_SOCKET); } // END - if // Last step: mark connection as initialized @@ -230,7 +230,7 @@ class BaseIpV4ConnectionHelper extends BaseConnectionHelper { $this->shutdownSocket($socketResource); // Throw it again - throw new SocketConnectionException(array($this, $socketResource, $socketError, $errorMessage), BaseListener::EXCEPTION_INVALID_SOCKET); + throw new SocketConnectionException(array($this, $socketResource, $socketError, $errorMessage), SocketHandler::EXCEPTION_INVALID_SOCKET); } /** @@ -253,7 +253,7 @@ class BaseIpV4ConnectionHelper extends BaseConnectionHelper { $this->shutdownSocket($socketResource); // Throw it again - throw new SocketConnectionException(array($this, $socketResource, $socketError, $errorMessage), BaseListener::EXCEPTION_INVALID_SOCKET); + throw new SocketConnectionException(array($this, $socketResource, $socketError, $errorMessage), SocketHandler::EXCEPTION_INVALID_SOCKET); } /** @@ -276,7 +276,7 @@ class BaseIpV4ConnectionHelper extends BaseConnectionHelper { $this->shutdownSocket($socketResource); // Throw it again - throw new SocketConnectionException(array($this, $socketResource, $socketError, $errorMessage), BaseListener::EXCEPTION_INVALID_SOCKET); + throw new SocketConnectionException(array($this, $socketResource, $socketError, $errorMessage), SocketHandler::EXCEPTION_INVALID_SOCKET); } /** @@ -299,7 +299,7 @@ class BaseIpV4ConnectionHelper extends BaseConnectionHelper { $this->shutdownSocket($socketResource); // Throw it again - throw new SocketConnectionException(array($this, $socketResource, $socketError, $errorMessage), BaseListener::EXCEPTION_INVALID_SOCKET); + throw new SocketConnectionException(array($this, $socketResource, $socketError, $errorMessage), SocketHandler::EXCEPTION_INVALID_SOCKET); } /** @@ -323,7 +323,7 @@ class BaseIpV4ConnectionHelper extends BaseConnectionHelper { $this->halfShutdownSocket($socketResource); // Throw it again - throw new SocketConnectionException(array($this, $socketResource, $socketError, $errorMessage), BaseListener::EXCEPTION_INVALID_SOCKET); + throw new SocketConnectionException(array($this, $socketResource, $socketError, $errorMessage), SocketHandler::EXCEPTION_INVALID_SOCKET); } /** @@ -346,7 +346,7 @@ class BaseIpV4ConnectionHelper extends BaseConnectionHelper { $this->shutdownSocket($socketResource); // Throw it again - throw new SocketConnectionException(array($this, $socketResource, $socketError, $errorMessage), BaseListener::EXCEPTION_INVALID_SOCKET); + throw new SocketConnectionException(array($this, $socketResource, $socketError, $errorMessage), SocketHandler::EXCEPTION_INVALID_SOCKET); } /** diff --git a/application/hub/classes/helper/connection/ipv4/tcp/class_TcpConnectionHelper.php b/application/hub/classes/helper/connection/ipv4/tcp/class_TcpConnectionHelper.php index 954c7f344..7ef993c25 100644 --- a/application/hub/classes/helper/connection/ipv4/tcp/class_TcpConnectionHelper.php +++ b/application/hub/classes/helper/connection/ipv4/tcp/class_TcpConnectionHelper.php @@ -62,7 +62,7 @@ class TcpConnectionHelper extends BaseIpV4ConnectionHelper implements Connection * possible here because that method would throw an * InvalidSocketException back. */ - throw new SocketCreationException(array($helperInstance, gettype($socketResource)), BaseListener::EXCEPTION_SOCKET_CREATION_FAILED); + throw new SocketCreationException(array($helperInstance, gettype($socketResource)), SocketHandler::EXCEPTION_SOCKET_CREATION_FAILED); } // END - if // Get socket error code for verification @@ -74,7 +74,7 @@ class TcpConnectionHelper extends BaseIpV4ConnectionHelper implements Connection $helperInstance->handleSocketError(__METHOD__, __LINE__, $socketResource, array('0.0.0.0', '0')); // Then throw again - throw new SocketCreationException(array($helperInstance, gettype($socketResource), $socketError, socket_strerror($socketError)), BaseListener::EXCEPTION_SOCKET_CREATION_FAILED); + throw new SocketCreationException(array($helperInstance, gettype($socketResource), $socketError, socket_strerror($socketError)), SocketHandler::EXCEPTION_SOCKET_CREATION_FAILED); } // END - if // Debug message @@ -169,7 +169,7 @@ class TcpConnectionHelper extends BaseIpV4ConnectionHelper implements Connection // Could not shutdown socket, this is fine if e.g. the other side is not connected, so analyse it if (socket_last_error($this->getSocketResource()) != 107) { // Something bad happened while we shutdown a socket - throw new SocketShutdownException($this, BaseListener::EXCEPTION_INVALID_SOCKET); + throw new SocketShutdownException($this, SocketHandler::EXCEPTION_INVALID_SOCKET); } // END - if } // END - if diff --git a/application/hub/classes/listener/tcp/class_TcpListener.php b/application/hub/classes/listener/tcp/class_TcpListener.php index 92eb02e16..c0539b83a 100644 --- a/application/hub/classes/listener/tcp/class_TcpListener.php +++ b/application/hub/classes/listener/tcp/class_TcpListener.php @@ -61,7 +61,7 @@ class TcpListener extends BaseListener implements Listenable { // Is the socket resource valid? if (!is_resource($mainSocket)) { // Something bad happened - throw new InvalidSocketException(array($this, $mainSocket), BaseListener::EXCEPTION_INVALID_SOCKET); + throw new InvalidSocketException(array($this, $mainSocket), SocketHandler::EXCEPTION_INVALID_SOCKET); } // END - if // Get socket error code for verification @@ -73,7 +73,7 @@ class TcpListener extends BaseListener implements Listenable { $this->handleSocketError(__METHOD__, __LINE__, $mainSocket, array('0.0.0.0', '0')); /* // Then throw again - throw new InvalidSocketException(array($this, $mainSocket, $socketError, socket_strerror($socketError)), BaseListener::EXCEPTION_INVALID_SOCKET); + throw new InvalidSocketException(array($this, $mainSocket, $socketError, socket_strerror($socketError)), SocketHandler::EXCEPTION_INVALID_SOCKET); */ } // END - if @@ -92,7 +92,7 @@ class TcpListener extends BaseListener implements Listenable { $this->shutdownSocket($mainSocket); // And throw again - throw new InvalidSocketException(array($this, $mainSocket, $socketError, $errorMessage), BaseListener::EXCEPTION_INVALID_SOCKET); + throw new InvalidSocketException(array($this, $mainSocket, $socketError, $errorMessage), SocketHandler::EXCEPTION_INVALID_SOCKET); */ } // END - if @@ -116,7 +116,7 @@ class TcpListener extends BaseListener implements Listenable { $this->shutdownSocket($mainSocket); // And throw again - throw new InvalidSocketException(array($this, $mainSocket, $socketError, $errorMessage), BaseListener::EXCEPTION_INVALID_SOCKET); + throw new InvalidSocketException(array($this, $mainSocket, $socketError, $errorMessage), SocketHandler::EXCEPTION_INVALID_SOCKET); */ } // END - if @@ -136,7 +136,7 @@ class TcpListener extends BaseListener implements Listenable { $this->shutdownSocket($mainSocket); // And throw again - throw new InvalidSocketException(array($this, $mainSocket, $socketError, $errorMessage), BaseListener::EXCEPTION_INVALID_SOCKET); + throw new InvalidSocketException(array($this, $mainSocket, $socketError, $errorMessage), SocketHandler::EXCEPTION_INVALID_SOCKET); */ } // END - if @@ -156,7 +156,7 @@ class TcpListener extends BaseListener implements Listenable { $this->shutdownSocket($mainSocket); // And throw again - throw new InvalidSocketException(array($this, $mainSocket, $socketError, $errorMessage), BaseListener::EXCEPTION_INVALID_SOCKET); + throw new InvalidSocketException(array($this, $mainSocket, $socketError, $errorMessage), SocketHandler::EXCEPTION_INVALID_SOCKET); */ } // END - if diff --git a/application/hub/classes/listener/udp/class_UdpListener.php b/application/hub/classes/listener/udp/class_UdpListener.php index 63dbd2f93..a5aff183e 100644 --- a/application/hub/classes/listener/udp/class_UdpListener.php +++ b/application/hub/classes/listener/udp/class_UdpListener.php @@ -62,7 +62,7 @@ class UdpListener extends BaseListener implements Listenable { // Is the socket a valid resource or do we have any error? if (!is_resource($mainSocket)) { // Then throw an InvalidSocketException - throw new InvalidSocketException(array($this, $mainSocket), BaseListener::EXCEPTION_INVALID_SOCKET); + throw new InvalidSocketException(array($this, $mainSocket), SocketHandler::EXCEPTION_INVALID_SOCKET); } // END - if /* @@ -85,7 +85,7 @@ class UdpListener extends BaseListener implements Listenable { $this->shutdownSocket($mainSocket); // And throw again - throw new InvalidSocketException(array($this, $mainSocket, $socketError, $errorMessage), BaseListener::EXCEPTION_INVALID_SOCKET); + throw new InvalidSocketException(array($this, $mainSocket, $socketError, $errorMessage), SocketHandler::EXCEPTION_INVALID_SOCKET); */ } // END - if @@ -105,7 +105,7 @@ class UdpListener extends BaseListener implements Listenable { $this->shutdownSocket($mainSocket); // And throw again - throw new InvalidSocketException(array($this, $mainSocket, $socketError, $errorMessage), BaseListener::EXCEPTION_INVALID_SOCKET); + throw new InvalidSocketException(array($this, $mainSocket, $socketError, $errorMessage), SocketHandler::EXCEPTION_INVALID_SOCKET); */ } // END - if @@ -125,7 +125,7 @@ class UdpListener extends BaseListener implements Listenable { $this->shutdownSocket($mainSocket); // And throw again - throw new InvalidSocketException(array($this, $mainSocket, $socketError, $errorMessage), BaseListener::EXCEPTION_INVALID_SOCKET); + throw new InvalidSocketException(array($this, $mainSocket, $socketError, $errorMessage), SocketHandler::EXCEPTION_INVALID_SOCKET); */ } // END - if diff --git a/application/hub/classes/package/assembler/class_PackageAssembler.php b/application/hub/classes/package/assembler/class_PackageAssembler.php index 192c54fb1..21d7fd110 100644 --- a/application/hub/classes/package/assembler/class_PackageAssembler.php +++ b/application/hub/classes/package/assembler/class_PackageAssembler.php @@ -28,6 +28,9 @@ class PackageAssembler extends BaseHubSystem implements Assembler, Registerable, */ const STACKER_NAME_MULTIPLE_MESSAGE = 'multiple_message'; + // Exception codes + const EXCEPTION_UNSUPPORTED_PACKAGE_CODE_HANDLER = 0xf2200; + /** * Pending data */ @@ -143,7 +146,7 @@ class PackageAssembler extends BaseHubSystem implements Assembler, Registerable, // Abort if the call-back method is not there if (!method_exists($this, $this->callbacks[$packageContent[BaseRawDataHandler::PACKAGE_ERROR_CODE]])) { // Throw an exception - throw new UnsupportedPackageCodeHandlerException(array($this, $this->callbacks[$packageContent[BaseRawDataHandler::PACKAGE_ERROR_CODE]], $packageContent), BaseListener::EXCEPTION_UNSUPPORTED_PACKAGE_CODE_HANDLER); + throw new UnsupportedPackageCodeHandlerException(array($this, $this->callbacks[$packageContent[BaseRawDataHandler::PACKAGE_ERROR_CODE]], $packageContent), self::EXCEPTION_UNSUPPORTED_PACKAGE_CODE_HANDLER); } // END - if // Call it back diff --git a/application/hub/classes/package/class_NetworkPackage.php b/application/hub/classes/package/class_NetworkPackage.php index 620e14728..c60064e4d 100644 --- a/application/hub/classes/package/class_NetworkPackage.php +++ b/application/hub/classes/package/class_NetworkPackage.php @@ -260,6 +260,12 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R const PROTOCOL_TCP = 'TCP'; const PROTOCOL_UDP = 'UDP'; + /************************************************************************** + * Exception codes * + **************************************************************************/ + const EXCEPTION_UNEXPECTED_PACKAGE_STATUS = 0xff00; + const EXCEPTION_INVALID_DATA_CHECKSUM = 0xff01; + /** * Protected constructor * @@ -992,7 +998,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R $this->handleSocketError(__METHOD__, __LINE__, $encodedDataArray[self::RAW_SOCKET_INDEX], array('0.0.0.0', '0')); // And throw it - throw new InvalidSocketException(array($this, $encodedDataArray[self::RAW_SOCKET_INDEX], $socketError, $errorMessage), BaseListener::EXCEPTION_INVALID_SOCKET); + throw new InvalidSocketException(array($this, $encodedDataArray[self::RAW_SOCKET_INDEX], $socketError, $errorMessage), SocketHandler::EXCEPTION_INVALID_SOCKET); } elseif (($sentBytes === 0) && (strlen($encodedDataArray[self::RAW_ENCODED_DATA_INDEX]) > 0)) { // Nothing sent means we are done //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('CONNECTION-HELPER[' . __METHOD__ . ':' . __LINE__ . ']: All sent! (LINE=' . __LINE__ . ')'); @@ -1268,7 +1274,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R // Is the package status 'failed'? if ($packageData[self::PACKAGE_DATA_STATUS] != self::PACKAGE_STATUS_FAILED) { // Not failed! - throw new UnexpectedPackageStatusException(array($this, $packageData, self::PACKAGE_STATUS_FAILED), BaseListener::EXCEPTION_UNEXPECTED_PACKAGE_STATUS); + throw new UnexpectedPackageStatusException(array($this, $packageData, self::PACKAGE_STATUS_FAILED), self::EXCEPTION_UNEXPECTED_PACKAGE_STATUS); } // END - if // Remove this entry @@ -1347,7 +1353,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R // Is the checksum valid? if (!$this->isChecksumValid($decodedContent, $decodedData)) { // Is not the same, so throw an exception here - throw new InvalidDataChecksumException(array($this, $decodedContent, $decodedData), BaseListener::EXCEPTION_INVALID_DATA_CHECKSUM); + throw new InvalidDataChecksumException(array($this, $decodedContent, $decodedData), self::EXCEPTION_INVALID_DATA_CHECKSUM); } // END - if /* diff --git a/application/hub/classes/pools/peer/class_DefaultPeerPool.php b/application/hub/classes/pools/peer/class_DefaultPeerPool.php index 90e76fde8..d4f02dba3 100644 --- a/application/hub/classes/pools/peer/class_DefaultPeerPool.php +++ b/application/hub/classes/pools/peer/class_DefaultPeerPool.php @@ -60,7 +60,7 @@ class DefaultPeerPool extends BasePool implements PoolablePeer { // Is it a valid resource? if (!is_resource($socketResource)) { // Throw an exception - throw new InvalidSocketException(array($this, $socketResource), BaseListener::EXCEPTION_INVALID_SOCKET); + throw new InvalidSocketException(array($this, $socketResource), SocketHandler::EXCEPTION_INVALID_SOCKET); } // END - if // Get error code @@ -78,7 +78,7 @@ class DefaultPeerPool extends BasePool implements PoolablePeer { $this->getListenerInstance()->shutdownSocket($socketResource); // And throw again - throw new InvalidSocketException(array($this, $socketResource, $errorCode, $errorMessage), BaseListener::EXCEPTION_INVALID_SOCKET); + throw new InvalidSocketException(array($this, $socketResource, $errorCode, $errorMessage), SocketHandler::EXCEPTION_INVALID_SOCKET); */ } // END - if } @@ -119,7 +119,7 @@ class DefaultPeerPool extends BasePool implements PoolablePeer { $lastError = socket_last_error($socketResource); // Doesn't work! - throw new InvalidSocketException(array($this, $socketResource, $lastError, socket_strerror($lastError)), BaseListener::EXCEPTION_INVALID_SOCKET); + throw new InvalidSocketException(array($this, $socketResource, $lastError, socket_strerror($lastError)), SocketHandler::EXCEPTION_INVALID_SOCKET); */ } // END - if } else { diff --git a/application/hub/classes/resolver/state/peer/class_PeerStateResolver.php b/application/hub/classes/resolver/state/peer/class_PeerStateResolver.php index 4429f1b91..082be9f32 100644 --- a/application/hub/classes/resolver/state/peer/class_PeerStateResolver.php +++ b/application/hub/classes/resolver/state/peer/class_PeerStateResolver.php @@ -73,7 +73,7 @@ class PeerStateResolver extends BaseStateResolver implements StateResolver { // Still no socket resource? if (!is_resource($socketResource)) { // Then abort here with an exception (may happen after socket_shutdown()) - throw new InvalidSocketException(array($helperInstance, $socketResource, 'unknown', 'unknown'), BaseListener::EXCEPTION_INVALID_SOCKET); + throw new InvalidSocketException(array($helperInstance, $socketResource, 'unknown', 'unknown'), SocketHandler::EXCEPTION_INVALID_SOCKET); } // END - if } // END - if diff --git a/application/hub/interfaces/pool/.htaccess b/application/hub/interfaces/pool/.htaccess deleted file mode 100644 index 3a4288278..000000000 --- a/application/hub/interfaces/pool/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/hub/interfaces/pool/class_Poolable.php b/application/hub/interfaces/pool/class_Poolable.php deleted file mode 100644 index 830430fad..000000000 --- a/application/hub/interfaces/pool/class_Poolable.php +++ /dev/null @@ -1,28 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Hub Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -interface Poolable extends FrameworkInterface { -} - -// [EOF] -?> diff --git a/application/hub/interfaces/pool/listener/.htaccess b/application/hub/interfaces/pool/listener/.htaccess deleted file mode 100644 index 3a4288278..000000000 --- a/application/hub/interfaces/pool/listener/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/hub/interfaces/pool/listener/class_PoolableListener.php b/application/hub/interfaces/pool/listener/class_PoolableListener.php deleted file mode 100644 index b0e7f1657..000000000 --- a/application/hub/interfaces/pool/listener/class_PoolableListener.php +++ /dev/null @@ -1,35 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Hub Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -interface PoolableListener extends Poolable { - /** - * Adds a listener instance to this pool - * - * @param $listenerInstance An instance of a Listenable class - * @return void - */ - function addListener (Listenable $listenerInstance); -} - -// [EOF] -?> diff --git a/application/hub/interfaces/pool/peer/.htaccess b/application/hub/interfaces/pool/peer/.htaccess deleted file mode 100644 index 3a4288278..000000000 --- a/application/hub/interfaces/pool/peer/.htaccess +++ /dev/null @@ -1 +0,0 @@ -Deny from all diff --git a/application/hub/interfaces/pool/peer/class_PoolablePeer.php b/application/hub/interfaces/pool/peer/class_PoolablePeer.php deleted file mode 100644 index 7920c3815..000000000 --- a/application/hub/interfaces/pool/peer/class_PoolablePeer.php +++ /dev/null @@ -1,61 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Hub Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -interface PoolablePeer extends Poolable, SocketTag { - /** - * Adds a socket resource to the peer pool - * - * @param $socketResource A valid (must be!) socket resource - * @param $connectionType Type of connection, can only be 'incoming', 'outgoing' or 'server' - * @return void - * @throws InvalidSocketException If the given resource is invalid or errorous - * @throws InvalidConnectionTypeException If the provided connection type is not valid - */ - function addPeer ($socketResource, $connectionType); - - /** - * Getter for array of all socket resource arrays - * - * @return $sockets An array with all socket arrays - */ - function getAllSockets (); - - /** - * Getter for array of all socket resources - * - * @return $sockets An array with all sockets - */ - function getAllSingleSockets (); - - /** - * "Getter" for all sockets of specified type - * - * @param $connectionType Type of connection, can only be 'incoming', 'outgoing' or 'server' - * @return $sockets An array with sockets of given type - * @throws InvalidConnectionTypeException If the provided connection type is not valid - */ - function getSocketsByConnectionType ($connectionType); -} - -// [EOF] -?> -- 2.39.5