LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Netcat, receiving broadcast (https://www.linuxquestions.org/questions/linux-networking-3/netcat-receiving-broadcast-860737/)

leftleaner 02-04-2011 12:36 PM

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?


All times are GMT -5. The time now is 01:54 AM.