diff --git a/tools/Makefile b/tools/Makefile index 8498370..9437a63 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -1,8 +1,9 @@ # -# Various OSC tools +# Various OSC (and UDP) tools # # https://git.tetalab.org/tTh/gadgets-OSC udp-dumper: udp-dumper.c Makefile gcc -Wall $< -o $@ + diff --git a/tools/udp-dumper.c b/tools/udp-dumper.c index 3f41ec5..cf76a76 100644 --- a/tools/udp-dumper.c +++ b/tools/udp-dumper.c @@ -45,6 +45,8 @@ long serial; double starttime, curtime; struct timeval tp; +fprintf(stderr, "%s: listen on port %d\n", __func__, port); + if (-1==(sock=socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP))) { perror("socket fail "); exit(1); @@ -77,11 +79,12 @@ do { if (verbosity) { gettimeofday(&tp, NULL); curtime = tp.tv_sec + tp.tv_usec / 1e6; - printf("----+ %5d b ts: %.3f\n", foo, curtime - starttime); + printf("----+ %4ld %5d b ts: %.3f\n", + serial, foo, curtime - starttime); } for (bar=0; bar<=foo; bar+=16) { - printf("%3ld | ", serial); + printf("%3ld | ", bar); dumpln(buffer+bar); } serial++;