+ /**
+ * Getter for array of all socket arrays
+ *
+ * @return $sockets An array with all socket arrays
+ */
+ public final function getAllSingleSockets () {
+ // Get the array list
+ $socketArrays = $this->getArrayFromList('pool');
+
+ // Init socket array
+ $sockets = array();
+
+ // "Walk" through all socket arrays
+ foreach ($socketArrays as $socketArray) {
+ // Add the socket
+ array_push($sockets, $socketArray[self::SOCKET_ARRAY_RESOURCE]);
+ } // END - foreach
+
+ // Return it
+ return $sockets;
+ }
+
+ /**
+ * "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
+ */
+ 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');
+
+ // Init socket array
+ $sockets = array();
+
+ // "Walk" through all socket arrays
+ foreach ($socketArrays as $socketArray) {
+ // Does it match?
+ if ($socketArray[self::SOCKET_ARRAY_CONN_TYPE] === $connectionType) {
+ // Add the socket
+ array_push($sockets, $socketArray[self::SOCKET_ARRAY_RESOURCE]);
+ } // END - if
+ } // END - foreach
+
+ // Return it
+ return $sockets;
+ }
+