0

I have problem I am trying to understand:

I am sending some UDP data to local host. It is a simple UDP packet with a counter. It counts up to 16 (0xF) and stops. When I grep the received data on the output, and grep only shows up to packet 11 (0xB) received. All the packets are actually received, but either grep or xxd is buffering. I have sent the data to a file to check if all is received, and the data is coming through.

[testuser %] netcat -l 127.0.0.1 -u -p 8777 | xxd -e -u | grep DEAD

00000000: 00000000 DEADBEEF FFFFFFFF DEADBEEF  ................
00000400: 00000001 DEADBEEF FFFFFFFF DEADBEEF  ................
00000800: 00000002 DEADBEEF FFFFFFFF DEADBEEF  ................
00000c00: 00000003 DEADBEEF FFFFFFFF DEADBEEF  ................
00001000: 00000004 DEADBEEF FFFFFFFF DEADBEEF  ................
00001400: 00000005 DEADBEEF FFFFFFFF DEADBEEF  ................
00001800: 00000006 DEADBEEF FFFFFFFF DEADBEEF  ................
00001c00: 00000007 DEADBEEF FFFFFFFF DEADBEEF  ................
00002000: 00000008 DEADBEEF FFFFFFFF DEADBEEF  ................
00002400: 00000009 DEADBEEF FFFFFFFF DEADBEEF  ................
00002800: 0000000A DEADBEEF FFFFFFFF DEADBEEF  ................
00002c00: 0000000B DEADBEEF FFFFFFFF DEADBEEF  ................

I suspect this is a buffering problem ... I used od (Octal dump) and I could see the full sequence, but I like the xxd output better and would like it to work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.