diff options
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); |