I am running a simple UDP server using Nodejs's dgram module.
Relevant code is simply:
server = dgram.createSocket('udp4');
sudo netstat -l
Proto Recv-Q Send-Q Local Address Foreign Address State
udp 0 0 localhost:10022 *:*
sudo nmap -sU -p 10022 192.168.7.171
Nmap scan report for 192.168.7.171
Host is up (0.00032s latency).
PORT STATE SERVICE
10022/udp closed unknown
address parameter of
bind() is optional, you can try to listen to all local addresses (
0.0.0.0) by omitting it but still specify the port. Eg:
Regarding the missing error UDP is by default a not reliable protocol, the transmission will be treated as successful when it's sent on the wire. UDP does not send back and acknowledgement packet, if you need a reliable channel you can use TCP.