我正在制作一个C程序,我需要检查目标计算机上打开的UDP端口。由于UDP是无连接的,我无法像使用TCP一样检查返回值connect()
。如何判断我是否将UDP数据包发送到开放端口?
send()
和sendto()
返回值也没有帮助。手册页指出:
No indication of failure to deliver is implicit in a send(). Locally
detected errors are indicated by a return value of -1.
如何判断是否将UDP数据包发送到目标主机上的开放端口?
不好意思问这个问题,但是如何知道它是否给我发送了ICMP端口 - 无法访问?谢谢。 – Marian 2011-01-09 15:40:09