putchunks: increase the default segment size to 8000 bytes
Change-Id: I16c2e21f168c77259d6bdc47b86fceb258521517
This commit is contained in:
1 parent
f8a14d88cb
commit
7c4246ca67
2 files changed
+15
-15
No files matched your search
@@ -26,11 +26,12 @@ Options
|
||||
|
||||
.. option:: -f, --freshness MILLISECS
|
||||
|
||||
FreshnessPeriod of the published Data packets, in milliseconds. Default = 10000 [ms].
|
||||
FreshnessPeriod of the published Data packets, in milliseconds.
|
||||
The default is 10000 (10 seconds).
|
||||
|
||||
.. option:: -s, --size BYTES
|
||||
|
||||
Maximum chunk size, in bytes. Default = 4400 [bytes].
|
||||
Maximum chunk size, in bytes. The default is 8000 bytes.
|
||||
|
||||
.. option:: -N, --naming-convention CONVENTION
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
||||
/*
|
||||
* Copyright (c) 2016-2019, Regents of the University of California,
|
||||
* Copyright (c) 2016-2021, Regents of the University of California,
|
||||
* Colorado State University,
|
||||
* University Pierre & Marie Curie, Sorbonne University.
|
||||
*
|
||||
@@ -38,9 +38,9 @@ namespace chunks {
|
||||
/**
|
||||
* @brief Segmented & versioned data publisher
|
||||
*
|
||||
* Packetizes and publishes data from an input stream under /prefix/<version>/<segment number>.
|
||||
* The current time is used as the version number. The store has always at least one element (also
|
||||
* with empty input stream).
|
||||
* Packetizes and publishes data from an input stream as `/prefix/<version>/<segment number>`.
|
||||
* Unless another value is provided, the current time is used as the version number.
|
||||
* The packet store always has at least one item, even when the input is empty.
|
||||
*/
|
||||
class Producer : noncopyable
|
||||
{
|
||||
@@ -48,8 +48,8 @@ public:
|
||||
struct Options
|
||||
{
|
||||
security::SigningInfo signingInfo;
|
||||
time::milliseconds freshnessPeriod{10000};
|
||||
size_t maxSegmentSize = MAX_NDN_PACKET_SIZE >> 1;
|
||||
time::milliseconds freshnessPeriod = 10_s;
|
||||
size_t maxSegmentSize = 8000;
|
||||
bool isQuiet = false;
|
||||
bool isVerbose = false;
|
||||
bool wantShowVersion = false;
|
||||
@@ -57,8 +57,7 @@ public:
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Create the Producer
|
||||
*
|
||||
* @brief Create the producer
|
||||
* @param prefix prefix used to publish data; if the last component is not a valid
|
||||
* version number, the current system time is used as version number.
|
||||
*/
|
||||
@@ -66,7 +65,7 @@ public:
|
||||
const Options& opts);
|
||||
|
||||
/**
|
||||
* @brief Run the Producer
|
||||
* @brief Run the producer
|
||||
*/
|
||||
void
|
||||
run();
|
||||
@@ -75,10 +74,10 @@ private:
|
||||
/**
|
||||
* @brief Split the input stream in data packets and save them to the store
|
||||
*
|
||||
* Create data packets reading all the characters from the input stream until EOF, or an
|
||||
* error occurs. Each data packet has a maximum payload size of m_maxSegmentSize value and is
|
||||
* stored inside the vector m_store. An empty data packet is created and stored if the input
|
||||
* stream is empty.
|
||||
* Create data packets reading all the characters from the input stream until EOF or an
|
||||
* error occurs. Each data packet has a maximum payload size of `m_options.maxSegmentSize`
|
||||
* bytes and is stored in the vector `m_store`. An empty data packet is created and stored
|
||||
* if the input stream is empty.
|
||||
*
|
||||
* @return Number of data packets contained in the store after the operation
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user