sending broadcast packets
-
hey. could anyone tell me how to send broadcast packets in C. For those of you who dont know what a broadcast packet is: "If you send a packet to 255.255.255.0 it goes to all the computers on the network" How can i also listen for broadcast packets. Basically, my requirement is that i have many computers on a LAN (roughtly around 30 - 50), the IP address of which are unknown. So i would like to find oit all the computes that are present on my network. I thinks this is a practical use for sending a broadcast packet.
-
hey. could anyone tell me how to send broadcast packets in C. For those of you who dont know what a broadcast packet is: "If you send a packet to 255.255.255.0 it goes to all the computers on the network" How can i also listen for broadcast packets. Basically, my requirement is that i have many computers on a LAN (roughtly around 30 - 50), the IP address of which are unknown. So i would like to find oit all the computes that are present on my network. I thinks this is a practical use for sending a broadcast packet.
to listen for a udp broadcast packet, just create a udp socket on the client machine, binding it to a certain port. eg: 22222. Then broadcasting socket should broadcast on that port.
-
to listen for a udp broadcast packet, just create a udp socket on the client machine, binding it to a certain port. eg: 22222. Then broadcasting socket should broadcast on that port.
okay. How can i create a UDP socket? ...and how can i send the UDP packet. Have you got any code to accomplish this?