Strange behaviour of netcat with UDP

前端 未结 4 597
天命终不由人
天命终不由人 2020-12-13 13:36

I noticed a strange behaviour working with netcat and UDP. I start an instance (instance 1) of netcat that listens on a UDP port:

nc -lu -p 10000
         


        
4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-13 13:38

    Use the -k option:

    nc -l -u -k 0.0.0.0 10000
    
    • -k means keep-alive, that netcat keeps listening after each connection
    • -u means UDP
    • -l listening on port 10000

提交回复
热议问题