X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=application%2Fhub%2Fmain%2Fpackage%2Fclass_NetworkPackage.php;h=0d1895047c500b738720f574d3c013ce8306b753;hb=fa1e85c6f610356bc1b4f7b01a57acce6741782f;hp=7d396a866993c2e7f3d9daf195ae6d0330f17d7a;hpb=2be1fa32243c0ed7c439b6a4226e01d8155c586b;p=hub.git diff --git a/application/hub/main/package/class_NetworkPackage.php b/application/hub/main/package/class_NetworkPackage.php index 7d396a866..0d1895047 100644 --- a/application/hub/main/package/class_NetworkPackage.php +++ b/application/hub/main/package/class_NetworkPackage.php @@ -625,10 +625,12 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R * stack. * * @param $helperInstance An instance of a Helper class - * @param $protocol Name of used protocol (TCP/UDP) * @return void */ - public function enqueueRawDataFromTemplate (Helper $helperInstance, $protocolName) { + public function enqueueRawDataFromTemplate (Helper $helperInstance) { + // Get protocol instance for recipient + $protocolInstance = ProtocolHandlerFactory::createProtocolFromRecipientHelper($helperInstance); + // Get the raw content ... $content = $helperInstance->getTemplateInstance()->getRawTemplateData(); //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('content(' . strlen($content) . ')=' . $content); @@ -658,7 +660,7 @@ class NetworkPackage extends BaseHubSystem implements Deliverable, Receivable, R $this->getStackInstance()->pushNamed(self::STACKER_NAME_UNDECLARED, array( self::PACKAGE_DATA_SENDER => $this->getSessionId(), self::PACKAGE_DATA_RECIPIENT => $helperInstance->getRecipientType(), - self::PACKAGE_DATA_PROTOCOL => $protocolName, + self::PACKAGE_DATA_PROTOCOL => $protocolInstance->getProtocolName(), self::PACKAGE_DATA_CONTENT => $packageContent, self::PACKAGE_DATA_STATUS => self::PACKAGE_STATUS_NEW, self::PACKAGE_DATA_SIGNATURE => $this->generatePackageSignature($packageContent, $this->getSessionId())