title: Checking open UDP Port in C++
body: <p>How can I check if a remote UDP port is open by using native C++? Since UDP is connection-less, calling <code>connect()</code> is not helpful. I cannot try binding it since it is not local. <code>nmap</code> cannot also indicate. (however <code>netstat</code> can find out, but I think it looks at internal information about open ports/files). Is there anyway to detect it? If I go a layer down on network level, is it possible to send a ICMP message by C++ to check port-unreachable status? I mean, would that give enough information on port status?</p>
  
  <p>Platform is Linux.</p>