]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/discovery/socket/class_PackageSocketDiscovery.php
Now incoming, outgoing and 'server' pools are possible
[hub.git] / application / hub / main / discovery / socket / class_PackageSocketDiscovery.php
index ef20e5c3acacf416f9ffbfd0fb1dd7329e17225f..9aea31d0056173213fc322be00822eea2e1018da 100644 (file)
@@ -97,11 +97,15 @@ class PackageSocketDiscovery extends BaseHubDiscovery implements DiscoverableSoc
         * matching socket resource for that protocol.
         *
         * @param       $packageData            Raw package data array
+        * @param       $connectionType         Type of connection, can be 'incoming' or 'outgoing', *NEVER* 'server'!
         * @return      $socketResource         A valid socket resource or FALSE if an error occured
         * @throws      NoListGroupException    If the procol group is not found in peer list
         * @throws      NullPointerException    If listenerInstance is NULL
         */
-       public function discoverSocket (array $packageData) {
+       public function discoverSocket (array $packageData, $connectionType) {
+               // Assert on type
+               assert($connectionType != BaseConnectionHelper::CONNECTION_TYPE_SERVER);
+
                // Determine protocol name
                $protocolName = $this->determineProtocolByPackageData($packageData);
 
@@ -126,7 +130,7 @@ class PackageSocketDiscovery extends BaseHubDiscovery implements DiscoverableSoc
                 * instance and pass over the whole package data to get the right
                 * socket.
                 */
-               $socketResource = $listenerInstance->getPoolInstance()->getSocketFromPackageData($packageData);
+               $socketResource = $listenerInstance->getPoolInstance()->getSocketFromPackageData($packageData, $connectionType);
 
                // Debug message
                if (is_resource($socketResource)) {