]> git.mxchange.org Git - hub.git/blobdiff - application/hub/interfaces/pool/peer/class_PoolablePeer.php
Now incoming, outgoing and 'server' pools are possible
[hub.git] / application / hub / interfaces / pool / peer / class_PoolablePeer.php
index b33fa5adf8044cf10eb11ef91d3a640f3c1fa1de..769a13edc30dce8a6ff83b17966c440a930b8ebf 100644 (file)
@@ -26,9 +26,33 @@ 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
         */
-       function addPeer ($socketResource);
+       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
+        */
+       function getSocketsByConnectionType ($connectionType);
 }
 
 // [EOF]