diff options
Diffstat (limited to 'Input')
-rw-r--r-- | Input/ICNConnectionConsumerApi.cpp | 25 | ||||
-rw-r--r-- | Input/ICNConnectionConsumerApi.h | 11 |
2 files changed, 28 insertions, 8 deletions
diff --git a/Input/ICNConnectionConsumerApi.cpp b/Input/ICNConnectionConsumerApi.cpp index 15475d5f..f983a054 100644 --- a/Input/ICNConnectionConsumerApi.cpp +++ b/Input/ICNConnectionConsumerApi.cpp @@ -55,8 +55,12 @@ ICNConnectionConsumerApi::ICNConnectionConsumerApi(double alpha, float beta, flo this->res = false; InitializeConditionVariable (&this->contentRetrieved); InitializeCriticalSection (&this->monitorMutex); - this->hTTPClientConnection = new libl4::http::HTTPClientConnection(); - libl4::transport::ConsumerSocket &c = this->hTTPClientConnection->getConsumer(); + this->hTTPClientConnection = new libl4::http::HTTPClientConnection(); +#ifdef HICNET + transport::interface::ConsumerSocket &c = this->hTTPClientConnection->getConsumer(); +#else + libl4::transport::ConsumerSocket &c = this->hTTPClientConnection->getConsumer(); +#endif bool configFile = false; //CHECK if we are not going to override the configuration file. (if !autotune) if(FILE *fp = fopen("/usr/etc/consumer.conf", "r")) @@ -64,14 +68,25 @@ ICNConnectionConsumerApi::ICNConnectionConsumerApi(double alpha, float beta, flo fclose(fp); configFile = true; } +#ifdef HICNET if(!configFile) { qDebug("beta %f, drop %f", this->beta, this->drop); - c.setSocketOption(libl4::transport::RaaqmTransportOptions::BETA_VALUE, this->beta); - c.setSocketOption(libl4::transport::RaaqmTransportOptions::DROP_FACTOR, this->drop); + c.setSocketOption(transport::interface::RaaqmTransportOptions::BETA_VALUE, this->beta); + c.setSocketOption(transport::interface::RaaqmTransportOptions::DROP_FACTOR, this->drop); } - c.setSocketOption(int(libl4::transport::RateEstimationOptions::RATE_ESTIMATION_OBSERVER), (libl4::transport::IcnObserver * )this); + c.setSocketOption(int(transport::interface::RateEstimationOptions::RATE_ESTIMATION_OBSERVER), (transport::protocol::IcnObserver * )this); +#else + if(!configFile) + { + qDebug("beta %f, drop %f", this->beta, this->drop); + + c.setSocketOption(libl4::transport::RaaqmTransportOptions::BETA_VALUE, this->beta); + c.setSocketOption(libl4::transport::RaaqmTransportOptions::DROP_FACTOR, this->drop); + } + c.setSocketOption(int(libl4::transport::RateEstimationOptions::RATE_ESTIMATION_OBSERVER), (libl4::transport::IcnObserver * )this); +#endif #ifdef NO_GUI if(this->icnAlpha != 20) this->icnRateBased = true; diff --git a/Input/ICNConnectionConsumerApi.h b/Input/ICNConnectionConsumerApi.h index 9a5f8a47..c05c5244 100644 --- a/Input/ICNConnectionConsumerApi.h +++ b/Input/ICNConnectionConsumerApi.h @@ -17,7 +17,8 @@ #define QTPLAYER_INPUT_ICNCONNECTIONCONSUMERAPI_H_ #if defined(HICNET) -#include <hicnet/hicnet_http_facade.h> +#include <hicn/transport/http/facade.h> +#include <hicn/transport/protocols/download_observer.h> #else #include <icnet/icnet_http_facade.h> #endif @@ -45,7 +46,6 @@ #include <errno.h> #include "../Portable/MultiThreading.h" -#include <boost/exception/diagnostic_information.hpp> //logging purpose #include <chrono> @@ -56,7 +56,13 @@ namespace libdash { namespace framework { namespace input { +#if defined(HICNET) +class ICNConnectionConsumerApi : public IICNConnection, public transport::protocol::IcnObserver{ +#else class ICNConnectionConsumerApi : public IICNConnection, public libl4::transport::IcnObserver{ +#endif + + public: ICNConnectionConsumerApi(double alpha, float beta, float drop); virtual ~ICNConnectionConsumerApi(); @@ -81,7 +87,6 @@ public: virtual void SetBeta(float beta); virtual void SetDrop(float drop); - //libl4::transport::IcnObserver virtual void notifyStats(double throughput); virtual void notifyDownloadTime(double downloadingTime); |