How to send only one UDP packet with netcat?

后端 未结 5 1842
挽巷
挽巷 2021-01-29 19:20

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

5条回答
  •  遥遥无期
    2021-01-29 19:54

    I had the same problem but I use -w 0 option to send only one packet and quit. You should use this command :

    echo -n "hello" | nc -4u -w0 localhost 8000
    

提交回复
热议问题