]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/pools/peer/class_DefaultPeerPool.php
Removed generic array handling, always have special arrays. Added verification of...
[hub.git] / application / hub / main / pools / peer / class_DefaultPeerPool.php
index 42fc143a63e52b05020af660575aa5b9d0f7b33a..7e4efe535d74b892900a628382d70e14cb095c4a 100644 (file)
@@ -180,8 +180,15 @@ class DefaultPeerPool extends BasePool implements PoolablePeer {
         *
         * @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
         */
        public function getSocketsByConnectionType ($connectionType) {
+               // Is the connection type valid?
+               if (!$this->isValidConnectionType($connectionType)) {
+                       // Is not a valid connection type!
+                       throw new InvalidConnectionTypeException(array($this, $connectionType), self::EXCEPTION_INVALID_CONNECTION_TYPE);
+               } // END - if
+
                // Get the array list
                $socketArrays = $this->getArrayFromList('pool');