udp-dumper: better display
This commit is contained in:
parent
c1327cf318
commit
6fdbf840b7
@ -1,8 +1,9 @@
|
|||||||
#
|
#
|
||||||
# Various OSC tools
|
# Various OSC (and UDP) tools
|
||||||
#
|
#
|
||||||
|
|
||||||
# https://git.tetalab.org/tTh/gadgets-OSC
|
# https://git.tetalab.org/tTh/gadgets-OSC
|
||||||
|
|
||||||
udp-dumper: udp-dumper.c Makefile
|
udp-dumper: udp-dumper.c Makefile
|
||||||
gcc -Wall $< -o $@
|
gcc -Wall $< -o $@
|
||||||
|
|
||||||
|
@ -45,6 +45,8 @@ long serial;
|
|||||||
double starttime, curtime;
|
double starttime, curtime;
|
||||||
struct timeval tp;
|
struct timeval tp;
|
||||||
|
|
||||||
|
fprintf(stderr, "%s: listen on port %d\n", __func__, port);
|
||||||
|
|
||||||
if (-1==(sock=socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP))) {
|
if (-1==(sock=socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP))) {
|
||||||
perror("socket fail ");
|
perror("socket fail ");
|
||||||
exit(1);
|
exit(1);
|
||||||
@ -77,11 +79,12 @@ do {
|
|||||||
if (verbosity) {
|
if (verbosity) {
|
||||||
gettimeofday(&tp, NULL);
|
gettimeofday(&tp, NULL);
|
||||||
curtime = tp.tv_sec + tp.tv_usec / 1e6;
|
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) {
|
for (bar=0; bar<=foo; bar+=16) {
|
||||||
printf("%3ld | ", serial);
|
printf("%3ld | ", bar);
|
||||||
dumpln(buffer+bar);
|
dumpln(buffer+bar);
|
||||||
}
|
}
|
||||||
serial++;
|
serial++;
|
||||||
|
Loading…
Reference in New Issue
Block a user