473,854 Members | 1,401 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 6528
"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
3347
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 and then a small MultiCast "client" that sends out messages to this same address and port. The two...
7
7720
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 as long as I have the server process running I can ping the multicast IP and get a response. The...
1
1800
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 application. If I use the async BeginReceiveFrom method, I still have to call EndReceiveFrom to...
2
3131
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 "receiveFrom()" call doesn't return even though a packet trace capture (Ethereal) shows that the...
0
1360
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) UdpClient uc=new UdpClient(8899); uc.JoinMulticastGroup(IPAddress.Parse("224.1.2.3")); IPEndPoint ep=new...
3
2311
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
3609
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
8933
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 feature is a "Thunder Icon" near event name in VS IDE when intellisense works;).
0
1610
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
9751
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11024
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10756
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
10371
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7914
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7081
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4560
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
2
4159
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3186
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.