Comment 0 for bug 1079950

Revision history for this message
Mark Roduner (mark-roduner) wrote :

I had planned on using netcat as a UDP broadcast listener / server, for audio distribution, and in testing I found this neat little gem.

The UDP server below works, tested with wireshark (on both local, and remote machines):
<code>
nc -u -b 192.168.0.255 < /dev/random
</code>

However, the UDP receiver quits listening after one packet
<code>
nc -l -u -b -q -1 -p 9999
</code>

Example output as follows (using stdin rather than random for clarity)
Server:
<code>
$ nc -u -b 192.168.0.255 < /dev/stdin
test packet 1
test packet two
^C
</code>

Client(s):
<code>
$ nc -l -u -b -q -1 -p 9999
test packet 1
</code>
and then nothing else is received.