How to send only one UDP packet with netcat?

后端 未结 5 1847
挽巷
挽巷 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 20:13

    Netcat sends one packet per newline. So you're fine. If you do anything more complex then you might need something else.

    I was fooling around with Wireshark when I realized this. Don't know if it helps.

提交回复
热议问题