我想这很接近linux - Netcat 停止监听 UDP 流量 - 超级用户,但我想我最好还是问一下
至于netcat 的版本,我使用的是 Ubuntu 11.04 和netcat它的默认版本,我猜是这样的openbsd:
$ nc
This is nc from the netcat-openbsd package. An alternative nc is available
in the netcat-traditional package.
usage: nc [-46DdhklnrStUuvzC] [-i interval] [-P proxy_username] [-p source_port]
[-s source_ip_address] [-T ToS] [-w timeout] [-X proxy_protocol]
[-x proxy_address[:port]] [hostname] [port[s]]
Run Code Online (Sandbox Code Playgroud)
这就是我觉得奇怪的地方:第一种情况按预期工作 - 我在一个终端中打开了一个 UDP 服务器:
$ sudo nc -ul 5000
Run Code Online (Sandbox Code Playgroud)
...在另一个终端中,我启动了一个新的 UDP 客户端连接 - 我输入了hello3 次,每次都按 …