diff options
Diffstat (limited to 'src/TestStatsServer.cpp')
-rw-r--r-- | src/TestStatsServer.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/TestStatsServer.cpp b/src/TestStatsServer.cpp new file mode 100644 index 0000000..7ec0342 --- /dev/null +++ b/src/TestStatsServer.cpp @@ -0,0 +1,26 @@ +#include <stdio.h> +#include "StatsServer.h" + +#define NUMOF(x) (sizeof(x) / sizeof(*x)) + +int main(int argc, char **argv) +{ + int stats_example[] = {25, 24, 22, 21, 56, 56, 54, 53, 51, 45, 42, 39, 34, 30, 24, 15, 8, 4, 1, 0}; + StatsServer serv(2720); + + serv.registerInput("foo"); + while (true) { + for (int i = 0; i < NUMOF(stats_example); i++) { + usleep(400000); + serv.notifyBuffer("foo", stats_example[i]); + fprintf(stderr, "give %d\n", stats_example[i]); + + if (stats_example[i] == 0) { + serv.notifyUnderrun("foo"); + } + } + } + + return 0; +} + |