我正在製作一個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