UDP is by definition unreliable, unordered, and sessionless. If you need to know if a port is open, you probably want to initiate a TCP/IP connection to that particular port.
if you want to be creative, you could perhaps use nmap for this scanning, as that is well suited for checking a large number of ports over a network very efficiently -- just be careful to ensure you are scanning only computers you own, else you could easily get into trouble with your ISP, or worse...
Comment on Re: How read ICMP UDP port unreachable?
Note, UDP and TCP ports are completely separate things, thus checking using TCP/IP if a particular port is open will not tell you anything about whether the UDP port with the same number is open, at all.