I'm trying to print each arriving UDP packet. I'd like to use xxd to print the ascii contents as well as the raw data (as hex).
So far I've used
socat - udp4-listen:11255,reuseaddr,fork | xxd
This sort of works, but xxd buffers the input until it can print a complete line of output.
I'd like socat to execute a new command for each arriving udp packet. I've tried
socat -u udp4-listen:11255,reuseaddr,fork system:"/usr/bin/xxd - /tmp/foo"
It forks a new xxd for each packet (which is good) but keeps it running instead of closing the input after passing the packet.
Is there a way to make socat close the input of the forked process after passing the UDP packet?