Netcat, receiving broadcast
I want to use netcat to receive one short UDP broadcast sent to port 50100. I used the following:
IN=`nc -ul -p 50100 -s $HOST_IP -o c:/dumpFile`
I specified a host IP because my receiving machine is multi-homed. -o is included only for testing. I find the correct hex dump of the packet in dumpFile however the shell command does not terminate. The packet is binary so there is no known terminator but I don't know if that is the problem. I used -w 2 in the hope that the command would complete in 2 seconds but that did not help. It seems everything is working but termination. How can I fix this?
|