]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/discovery/class_BaseNodeDiscovery.php
Refacturing to pass a ProtocolHandler instance instead of the direct name. This
[hub.git] / application / hub / main / discovery / class_BaseNodeDiscovery.php
index a608b7b07b16bbd6b84e0634e7b1a5fc46bbde26..110d2e5c4d69f8c9d55250a7b855f69f2036b105 100644 (file)
@@ -43,8 +43,8 @@ class BaseNodeDiscovery extends BaseDiscovery implements Discoverable {
        /**
         * Determines the protoctol name
         *
-        * @param       $packageData    Valid package data
-        * @return      $protocolName   Name of used protocol (TCP/UDP/etc.)
+        * @param       $packageData            Valid package data
+        * @return      $protocolInstance       An instance of a ProtocolHandler class
         */
        protected function determineProtocolByPackageData (array $packageData) {
                // First we need a tags instance
@@ -57,10 +57,10 @@ class BaseNodeDiscovery extends BaseDiscovery implements Discoverable {
                 * and if so we can re-use it. If there is no socket registered, we try
                 * to make a new connection (TCP or UDP) to the given IP:port.
                 */
-               $protocolName = $tagsInstance->chooseProtocolFromPackageData($packageData);
+               $protocolInstance = $tagsInstance->chooseProtocolFromPackageData($packageData);
 
                // Return it
-               return $protocolName;
+               return $protocolInstance;
        }
 
        /**