我正在制作一个C程序,我需要检查目标计算机上打开的UDP端口.因为UDP是无连接的,所以connect()我无法用TCP 检查返回值.
send()和sendto()返回值也没有帮助.手册页说明:
No indication of failure to deliver is implicit in a send(). Locally
detected errors are indicated by a return value of -1.
Run Code Online (Sandbox Code Playgroud)
如何判断是否将UDP数据包发送到目标主机上的开放端口?