473,566 Members | 2,785 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cannot receive Multicast package

Hi All,

There are two network cards in one computer (named A) , and there is one
network card in another computer(named B).

On computer A: one network card is used to connect to internet, and the
other network card is used in intranet whose ipaddress is 192.168.0.1
On computer B: the network card's ipaddress is 192.168.0.2.

These two computer can connect to each other.

The question is :
B can receive multicast sent from A, A cannot receive the package from B
(A can receive multicast package from itself)
If disable the internet network card on A, A can receive multicast
package from B.

Would you please give me some advise on this issue.

Thanks ,

Phlics.
Nov 15 '05 #1
6 6486
"PHLICS_Adm in" <ph****@hotmail .com> wrote in message news:<O3******* *******@TK2MSFT NGP09.phx.gbl>. ..
Hi All,

There are two network cards in one computer (named A) , and there is one
network card in another computer(named B).

On computer A: one network card is used to connect to internet, and the
other network card is used in intranet whose ipaddress is 192.168.0.1
On computer B: the network card's ipaddress is 192.168.0.2.

These two computer can connect to each other.

The question is :
B can receive multicast sent from A, A cannot receive the package from B
(A can receive multicast package from itself)
If disable the internet network card on A, A can receive multicast
package from B.

Phlics -

When you have more than one network card in a computer, you should
specify which card you want to receive multicast messages on in your
socket constructor, otherwise the socket will choose one for itself
(which may or may not be a good thing).

If you are using a UdpClient object, this would look like:

IPEndPoint iep = new IPEndPoint(IPAd dress.Parse("19 2.168.0.1"),
9050);
UdpClient sock = new UdpClient(iep);
sock.JoinMultic astGroup(IPAddr ess.Parse("224. 100.0.1"));

If you are using a Socket object, it would look like this:

Socket sock = new Socket(AddressF amily.InterNetw ork,
SocketType.Dgra m,
ProtocolType.Ud p);
IPEndPoint iep = new IPEndPoint(IPAd dress.Parse("19 2.168.0.1"),
9050);
sock.Bind(iep);
sock.SetSocketO ption(SocketLev el.IP,
SocketOptionNam e.AddMembership ,
new
MulticastOption (IPAddress.Pars e("224.100.0.1" )));
As a side note, if you want to receive multicast packets on both
interfaces, you can use the IPAddress.Any value for the IPEndPoint
constructor. Hope this helps solve your problem.

Rich Blum - Author
"C# Network Programming" (Sybex)
http://www.sybex.com/sybexbooks.nsf/Booklist/4176
"Network Performance Open Source Toolkit" (Wiley)
http://www.wiley.com/WileyCDA/WileyT...471433012.html
Nov 15 '05 #2
Thanks , but it does not work.

Other information:
If I switch the network cards(change the card used for internet to
intranet ...), it works .

Regards,
"Rich Blum" <ri*******@juno .com> wrote in message
news:cc******** *************** **@posting.goog le.com...
"PHLICS_Adm in" <ph****@hotmail .com> wrote in message

news:<O3******* *******@TK2MSFT NGP09.phx.gbl>. ..
Hi All,

There are two network cards in one computer (named A) , and there is one
network card in another computer(named B).

On computer A: one network card is used to connect to internet, and the
other network card is used in intranet whose ipaddress is 192.168.0.1
On computer B: the network card's ipaddress is 192.168.0.2.

These two computer can connect to each other.

The question is :
B can receive multicast sent from A, A cannot receive the package from B (A can receive multicast package from itself)
If disable the internet network card on A, A can receive multicast
package from B.

Phlics -

When you have more than one network card in a computer, you should
specify which card you want to receive multicast messages on in your
socket constructor, otherwise the socket will choose one for itself
(which may or may not be a good thing).

If you are using a UdpClient object, this would look like:

IPEndPoint iep = new IPEndPoint(IPAd dress.Parse("19 2.168.0.1"),
9050);
UdpClient sock = new UdpClient(iep);
sock.JoinMultic astGroup(IPAddr ess.Parse("224. 100.0.1"));

If you are using a Socket object, it would look like this:

Socket sock = new Socket(AddressF amily.InterNetw ork,
SocketType.Dgra m,
ProtocolType.Ud p);
IPEndPoint iep = new IPEndPoint(IPAd dress.Parse("19 2.168.0.1"),
9050);
sock.Bind(iep);
sock.SetSocketO ption(SocketLev el.IP,
SocketOptionNam e.AddMembership ,
new
MulticastOption (IPAddress.Pars e("224.100.0.1" )));
As a side note, if you want to receive multicast packets on both
interfaces, you can use the IPAddress.Any value for the IPEndPoint
constructor. Hope this helps solve your problem.

Rich Blum - Author
"C# Network Programming" (Sybex)
http://www.sybex.com/sybexbooks.nsf/Booklist/4176
"Network Performance Open Source Toolkit" (Wiley)
http://www.wiley.com/WileyCDA/WileyT...471433012.html

Nov 15 '05 #3
Following code snip is used :

this._clsMCastR eceiver = new Socket(AddressF amily.InterNetw ork,
SocketType.Dgra m, ProtocolType.Ud p);
IPEndPoint ipep=new IPEndPoint(IPAd dress.Any , CIMSys.MCastPor t);
this._clsMCastR eceiver.Bind(ip ep);
IPAddress ip=IPAddress.Pa rse(CIMSys.MCas tIPAddress);

this._clsMCastR eceiver.SetSock etOption(Socket OptionLevel.IP,
SocketOptionNam e.AddMembership , new MulticastOption (ip , IPAddress.Any)) ;

When I disable the internet network card , it works correctly.

Please give me advise on it .

Thanks,

Phlics.

"Rich Blum" <ri*******@juno .com> wrote in message
news:cc******** *************** **@posting.goog le.com...
"PHLICS_Adm in" <ph****@hotmail .com> wrote in message

news:<O3******* *******@TK2MSFT NGP09.phx.gbl>. ..
Hi All,

There are two network cards in one computer (named A) , and there is one
network card in another computer(named B).

On computer A: one network card is used to connect to internet, and the
other network card is used in intranet whose ipaddress is 192.168.0.1
On computer B: the network card's ipaddress is 192.168.0.2.

These two computer can connect to each other.

The question is :
B can receive multicast sent from A, A cannot receive the package from B (A can receive multicast package from itself)
If disable the internet network card on A, A can receive multicast
package from B.

Phlics -

When you have more than one network card in a computer, you should
specify which card you want to receive multicast messages on in your
socket constructor, otherwise the socket will choose one for itself
(which may or may not be a good thing).

If you are using a UdpClient object, this would look like:

IPEndPoint iep = new IPEndPoint(IPAd dress.Parse("19 2.168.0.1"),
9050);
UdpClient sock = new UdpClient(iep);
sock.JoinMultic astGroup(IPAddr ess.Parse("224. 100.0.1"));

If you are using a Socket object, it would look like this:

Socket sock = new Socket(AddressF amily.InterNetw ork,
SocketType.Dgra m,
ProtocolType.Ud p);
IPEndPoint iep = new IPEndPoint(IPAd dress.Parse("19 2.168.0.1"),
9050);
sock.Bind(iep);
sock.SetSocketO ption(SocketLev el.IP,
SocketOptionNam e.AddMembership ,
new
MulticastOption (IPAddress.Pars e("224.100.0.1" )));
As a side note, if you want to receive multicast packets on both
interfaces, you can use the IPAddress.Any value for the IPEndPoint
constructor. Hope this helps solve your problem.

Rich Blum - Author
"C# Network Programming" (Sybex)
http://www.sybex.com/sybexbooks.nsf/Booklist/4176
"Network Performance Open Source Toolkit" (Wiley)
http://www.wiley.com/WileyCDA/WileyT...471433012.html

Nov 15 '05 #4
"PHLICS_Adm in" <ph****@hotmail .com> wrote in message news:<OD******* *******@TK2MSFT NGP12.phx.gbl>. ..
this._clsMCastR eceiver.SetSock etOption(Socket OptionLevel.IP,
SocketOptionNam e.AddMembership , new MulticastOption (ip , IPAddress.Any)) ;

When I disable the internet network card , it works correctly.

Phlics -

Have you tried using the MulticastOption constructor that only
uses the multicast IP address, and not the local IP address?
Alternatively, have you tried specifying just the proper network card
IP address as the local address?

Rich Blum - Author
"C# Network Programming" (Sybex)
http://www.sybex.com/sybexbooks.nsf/Booklist/4176
"Network Performance Open Source Toolkit" (Wiley)
http://www.wiley.com/WileyCDA/WileyT...471433012.html
Nov 15 '05 #5
I have tried , but it does not work .

There are two network card on the computer. If disable the network card
(which connect to internet) , it works .

Thanks,

"Rich Blum" <ri*******@juno .com> wrote in message
news:cc******** *************** ***@posting.goo gle.com...
"PHLICS_Adm in" <ph****@hotmail .com> wrote in message

news:<OD******* *******@TK2MSFT NGP12.phx.gbl>. ..
this._clsMCastR eceiver.SetSock etOption(Socket OptionLevel.IP,
SocketOptionNam e.AddMembership , new MulticastOption (ip , IPAddress.Any)) ;
When I disable the internet network card , it works correctly.

Phlics -

Have you tried using the MulticastOption constructor that only
uses the multicast IP address, and not the local IP address?
Alternatively, have you tried specifying just the proper network card
IP address as the local address?

Rich Blum - Author
"C# Network Programming" (Sybex)
http://www.sybex.com/sybexbooks.nsf/Booklist/4176
"Network Performance Open Source Toolkit" (Wiley)
http://www.wiley.com/WileyCDA/WileyT...471433012.html

Nov 15 '05 #6
Following code snip is used :

this._clsMCastR eceiver = new Socket(AddressF amily.InterNetw ork,
SocketType.Dgra m, ProtocolType.Ud p);
IPEndPoint ipep=new IPEndPoint(IPAd dress.Any , CIMSys.MCastPor t);
this._clsMCastR eceiver.Bind(ip ep);
IPAddress ip=IPAddress.Pa rse(CIMSys.MCas tIPAddress);

this._clsMCastR eceiver.SetSock etOption(Socket OptionLevel.IP,
SocketOptionNam e.AddMembership , new MulticastOption (ip , IPAddress.Any)) ;

When I disable the internet network card , it works correctly.

Please give me advise on it .

Thanks,

Phlics.

"PHLICS_Adm in" <ph****@hotmail .com> wrote in message
news:O3******** ******@TK2MSFTN GP09.phx.gbl...
Hi All,

There are two network cards in one computer (named A) , and there is one
network card in another computer(named B).

On computer A: one network card is used to connect to internet, and the
other network card is used in intranet whose ipaddress is 192.168.0.1
On computer B: the network card's ipaddress is 192.168.0.2.

These two computer can connect to each other.

The question is :
B can receive multicast sent from A, A cannot receive the package from B (A can receive multicast package from itself)
If disable the internet network card on A, A can receive multicast
package from B.

Would you please give me some advise on this issue.

Thanks ,

Phlics.

Nov 15 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3340
by: Alfred B. Thordarson | last post by:
Hi All. I have this weird problem that on my devlepment machine (Windows XP) I don't receive MultiCast messages that I send from my machine. This means that my two processes can't communicate using MultiCast if they both run on the same machine. I have created a small MultiCast "server" which is listening for messages on 224.100.0.1:8932...
7
7697
by: Jim H | last post by:
Is there something special I need to do to send data to a multicast IP and have it go across a router? Router is a Win2000 Server connecting 2 networks via RRAS PPTP. The routing appears to be working because I can ping the multicast address and get responses from the server on the other network. I didn't think ping would work like that but...
1
1788
by: Dan Kelley | last post by:
I am writing a server component that will raise various "events" using UDP multicast events. A number of winform clients will begin receiving these events on a background thread, listening on the muticast address. My question is, is there a way of shutting down these threads without calling Thread.Abort, e.g. when the user shutsdown the...
2
3114
by: Terry | last post by:
I've got a strange problem receiving multicast packets in a C# application. What's strange is that it works *sometimes* but not always. I create a socket, call bind(), set the multicast socket option and then fire off a thread that calls "receiveFrom()" in a loop. This works sometimes, but other times it'll get into a funk where the...
0
1346
by: Nuno Magalhaes | last post by:
I've build an application that sends UDP packets to a multicast address 224.1.2.3 but in my other application I can't receive that packets using the code below. It blocks on receive. Any suggestions? (I can see the packets arriving at 224.1.2.3:554 on the client machine since I'm running the server and the client on the same machine) ...
3
2290
by: greenxiar | last post by:
My Computer is Win2K3 R2, Code is: using System; using System.Net; using System.Net.Sockets; using System.Threading; namespace TechUDPBroadcast { class Program { static void Main(string args) {
2
3595
by: rodrigofsilva | last post by:
Dear, by chance somebody already got to send and to receive files for protocol Multicast in C #. I am to send messages and to receive messages but files are not getting. In case somebody has already done. Thank you
5
8899
by: AliRezaGoogle | last post by:
Hi, I have a conceptual question on Events and Multicast Delegates. Let me explain: As we know an event is a multicast delegate. What we declare as an event is inherently a multicast delegate. I really do not undrestand what additional features the "event" keyword adds to multicast delegate. The only thing that I see as an additional...
0
1590
by: Stodge | last post by:
I'm trying to get a simple multicast application working using Twisted; so far I have: from twisted.internet.protocol import DatagramProtocol from twisted.internet import reactor from twisted.application.internet import MulticastServer class MulticastServerUDP(DatagramProtocol): def startProtocol(self): print 'Started Listening'
0
7666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7584
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8108
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7644
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2083
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1201
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.