Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Broadcasting through a socket
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Broadcasting through a socket
Divers
Thread ID:
00964385
Message ID:
00964385
Vues:
35
I need to learn more about broadcasting on a socket.

I have installed an additional network adapter on my computer and assigned it IP address 192.168.50.10. I have connected one device to that networkadapter, the device's IP address is 192.168.50.50.

Now if I run the following code:
IPEndPoint ipEP = new IPEndPoint(IPAddress.Parse("192.168.50.255"),0x77FE);				
Socket s = new Socket(ipEP.Address.AddressFamily, SocketType.Dgram, ProtocolType.Udp);

s.SendTo(msg, 0, msg.Length, SocketFlags.None, ipEP);
				
IPEndPoint senderEP = new IPEndPoint(IPAddress.Any, 0x77FE);
EndPoint tempRemoteEP = (EndPoint)senderEP;
				
s.ReceiveFrom(buffer, 0, 1024, SocketFlags.None, ref tempRemoteEP);
I get a response from the device that indicates that the device's IP address is 192.168.50.50, which is correct, but if I broadcast to 192.168.255.255 instead of 192.168.50.255 I do not get a response.

If anyone can give me more information regarding this please let me know. Any article or book refences would be welcome as well.

Thanks,
Einar
Semper ubi sub ubi.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform