Ok, I found the way to make it work.
I didn't notice the day I read the article (
http://www.codeproject.com/csharp/multicast.asp ) that at the bottom of the page there was a little forum.
The problem were two:
First seems that XP sp2 and Windows 2003 throw an exception when the socket sender join a multicast group ( which is not needed in order to send, only the receivers need to join a multicast group in order to receive).
So, I commented out the line:
s.SetSocketOption(SocketOptionLevel.IP,
SocketOptionName.AddMembership, new MulticastOption(ip));
which was throwing the exception.
Once removed there was still one problem: the receiver seemed not to receive any data.
Well I later discovered that this occurs when there are multiple Network Cards or, in my case when there's more than one IP address binded. In my case my ISP, AO(hel)L gives me another 2 IPs on top of the one of my Nic which connets my Lan.
So as you were saying I had to make sure I was binding the socket to the desired interface.
This is accomplisced with the following codes:
IPAddress ipa = IPAddress.Parse("192.0.0.11");
int ad = (int) ipa.Address;
s.SetSocketOption( SocketOptionLevel.IP, SocketOptionName.MulticastInterface, ad );
This seems to solve my problems.
Quote:
|
Originally Posted by kurifu
Does you network actually support multicasting? I am assuming you actually know what it is at this point.
The issue with multicasting is that the Internet does not actually support it right now, and 99% of ISPs have multicasting disabled on their networks, even if you set up a LAN I think multicasting is disabled by default since for most practicalities LANs will not make efficient use of the protocol. This is most likely why you are not getting multicasting to work.
Set up a LAN which supports multicasting, make sure it is enabled (not sure how to check that at this moment) and make sure you bind specifically to the interfaces that support the multicasting and you will probably not get that error any longer.
In any case, good luck.
|
Well as you said, multicasting is also implemented at the hardware level: the routers need to support Multicast and not many routers on internet support it (Even though I read, it's a matter of upgrading the router software and settings)
The following article anyway explains that a process called tunnelling manages to enable the delivery of multicast message over not multicast enabled networks.
http://www.microsoft.com/windows/win...e/multiwp.aspx
I couldn't try yet this class over the internet, just over my Lan (which doesn't have any router so of course it's fine) so I won't be able to say whether it works or not over the internet, but I'm confident it will because of tunnelling.
I'm pretty sure AOL is not multicast enabled ( actually when I rang them up and ask them, they (the technical department) didn't know what multicast is, they suggested me to go to their online help chat, as they said,it is more technical (?), but even the chat guys didn't know what multicast is. ( Are they a real ISP??? I couldn't believe!!! They didn't even know what contention ratio is and I had to explain to them!!!! How can they be so popular!?!

)), anyway I was able to view some multicast streaming on my Real Player.
So it's seems that joining a multicast group from a not multicast enabled network is possible.
Anybody knows whether is possible to do all the way around: sending multicat messages from a non multicast network?