diff options
author | michele papalini <micpapal+fdio@cisco.com> | 2019-01-24 16:04:03 +0100 |
---|---|---|
committer | michele papalini <micpapal+fdio@cisco.com> | 2019-01-24 16:04:03 +0100 |
commit | e718d5b93c9856d38b358fbb256327c8c76d387f (patch) | |
tree | 44066a01d3a7e2529cfb44bd9a8286d8bbddc3a8 /libtransport | |
parent | 9f9be9f2b6027be75395bd09d47f70e7ccce0e7f (diff) |
new constructors for RTC producer/consumer sockets
Change-Id: Icb982937e1f4cb38a2487f17c5a6b0cb1ef89cc2
Signed-off-by: michele papalini <micpapal+fdio@cisco.com>
Diffstat (limited to 'libtransport')
4 files changed, 26 insertions, 0 deletions
diff --git a/libtransport/src/hicn/transport/interfaces/rtc_socket_consumer.cc b/libtransport/src/hicn/transport/interfaces/rtc_socket_consumer.cc index de3e84417..cc4f478af 100755 --- a/libtransport/src/hicn/transport/interfaces/rtc_socket_consumer.cc +++ b/libtransport/src/hicn/transport/interfaces/rtc_socket_consumer.cc @@ -22,6 +22,9 @@ namespace interface { RTCConsumerSocket::RTCConsumerSocket(int protocol, asio::io_service &io_service) : ConsumerSocket(protocol, io_service) {} +RTCConsumerSocket::RTCConsumerSocket(int protocol) + : ConsumerSocket(protocol) {} + RTCConsumerSocket::~RTCConsumerSocket() {} void RTCConsumerSocket::handleRTCPPacket(uint8_t *packet, size_t len) { diff --git a/libtransport/src/hicn/transport/interfaces/rtc_socket_consumer.h b/libtransport/src/hicn/transport/interfaces/rtc_socket_consumer.h index 86ccf6e22..cfde3128d 100755 --- a/libtransport/src/hicn/transport/interfaces/rtc_socket_consumer.h +++ b/libtransport/src/hicn/transport/interfaces/rtc_socket_consumer.h @@ -25,6 +25,8 @@ class RTCConsumerSocket : public ConsumerSocket { public: explicit RTCConsumerSocket(int protocol, asio::io_service &io_service); + explicit RTCConsumerSocket(int protocol); + ~RTCConsumerSocket(); void handleRTCPPacket(uint8_t *packet, size_t len); diff --git a/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc b/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc index 7b39e7ac9..f19502dee 100644 --- a/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc +++ b/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc @@ -55,6 +55,24 @@ RTCProducerSocket::RTCProducerSocket(asio::io_service &io_service) prodLabel_ = ((rand() % 255) << 24UL); } +RTCProducerSocket::RTCProducerSocket() + : ProducerSocket(), + currentSeg_(1), + nack_(std::make_shared<ContentObject>()), + producedBytes_(0), + producedPackets_(0), + bytesProductionRate_(0), + packetsProductionRate_(INIT_PACKET_PRODUCTION_RATE), + perSecondFactor_(1000 / STATS_INTERVAL_DURATION) { + auto nack_payload = utils::MemBuf::create(NACK_HEADER_SIZE); + nack_payload->append(NACK_HEADER_SIZE); + nack_->appendPayload(std::move(nack_payload)); + lastStats_ = std::chrono::steady_clock::now(); + srand(time(NULL)); + prodLabel_ = ((rand() % 255) << 24UL); +} + + RTCProducerSocket::~RTCProducerSocket() {} void RTCProducerSocket::registerName(Prefix &producer_namespace) { diff --git a/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.h b/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.h index 1a42bdc56..f1bcaa9e8 100755 --- a/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.h +++ b/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.h @@ -28,6 +28,9 @@ namespace interface { class RTCProducerSocket : public ProducerSocket { public: RTCProducerSocket(asio::io_service &io_service); + + RTCProducerSocket(); + ~RTCProducerSocket(); void registerName(Prefix &producer_namespace); |