I want to send only one short value in a UDP packet, but running the command
echo -n \"hello\" | nc -4u localhost 8000
I can see that the serve
On a current netcat (v0.7.1) you have a -c switch:
-c, --close close connection on EOF from stdin
Hence,
echo "hi" | nc -cu localhost 8000
should do the trick.