How to get a list of IP addresses that are connected to a broadcast IP address using the Udp protocol?
There is such code:
UdpClient _onlineInformer = new UdpClient() { EnableBroadcast = true, Ttl = 1 }; _onlineInformer.Connect("192.168.152.255", 0);
How can _onlineInformer
find out about the connected sockets at the same address?
netstat
command for UDP protocol in the column'Local Address'
after ':' the port number. In * nix you can runlsof
root @ avp-xub11: ~ # lsof -i4UDP COMMAND PID USER FD TYPE DEVICE SIZE / OFF NODE NAME avahi-dae 527 avahi 13u IPv4 7150 0t0 UDP * dae 527 avahi 15u IPv4 7152 0t0 UDP *: 46109 rpcbind 539 root 6u IPv4 7200 0t0 UDP *: sunrpc rpcbind 539 root 7u IPv4 7201 0t0 UDP *: 713 .... There is a port in the NAME column. - avp pm