473,473 Members | 2,232 Online
Bytes | Software Development & Data Engineering Community
Create 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 6465
"PHLICS_Admin" <ph****@hotmail.com> wrote in message news:<O3**************@TK2MSFTNGP09.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(IPAddress.Parse("192.168.0.1"),
9050);
UdpClient sock = new UdpClient(iep);
sock.JoinMulticastGroup(IPAddress.Parse("224.100.0 .1"));

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

Socket sock = new Socket(AddressFamily.InterNetwork,
SocketType.Dgram,
ProtocolType.Udp);
IPEndPoint iep = new IPEndPoint(IPAddress.Parse("192.168.0.1"),
9050);
sock.Bind(iep);
sock.SetSocketOption(SocketLevel.IP,
SocketOptionName.AddMembership,
new
MulticastOption(IPAddress.Parse("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.google.co m...
"PHLICS_Admin" <ph****@hotmail.com> wrote in message

news:<O3**************@TK2MSFTNGP09.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(IPAddress.Parse("192.168.0.1"),
9050);
UdpClient sock = new UdpClient(iep);
sock.JoinMulticastGroup(IPAddress.Parse("224.100.0 .1"));

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

Socket sock = new Socket(AddressFamily.InterNetwork,
SocketType.Dgram,
ProtocolType.Udp);
IPEndPoint iep = new IPEndPoint(IPAddress.Parse("192.168.0.1"),
9050);
sock.Bind(iep);
sock.SetSocketOption(SocketLevel.IP,
SocketOptionName.AddMembership,
new
MulticastOption(IPAddress.Parse("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._clsMCastReceiver = new Socket(AddressFamily.InterNetwork,
SocketType.Dgram, ProtocolType.Udp);
IPEndPoint ipep=new IPEndPoint(IPAddress.Any , CIMSys.MCastPort);
this._clsMCastReceiver.Bind(ipep);
IPAddress ip=IPAddress.Parse(CIMSys.MCastIPAddress);

this._clsMCastReceiver.SetSocketOption(SocketOptio nLevel.IP,
SocketOptionName.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.google.co m...
"PHLICS_Admin" <ph****@hotmail.com> wrote in message

news:<O3**************@TK2MSFTNGP09.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(IPAddress.Parse("192.168.0.1"),
9050);
UdpClient sock = new UdpClient(iep);
sock.JoinMulticastGroup(IPAddress.Parse("224.100.0 .1"));

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

Socket sock = new Socket(AddressFamily.InterNetwork,
SocketType.Dgram,
ProtocolType.Udp);
IPEndPoint iep = new IPEndPoint(IPAddress.Parse("192.168.0.1"),
9050);
sock.Bind(iep);
sock.SetSocketOption(SocketLevel.IP,
SocketOptionName.AddMembership,
new
MulticastOption(IPAddress.Parse("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_Admin" <ph****@hotmail.com> wrote in message news:<OD**************@TK2MSFTNGP12.phx.gbl>...
this._clsMCastReceiver.SetSocketOption(SocketOptio nLevel.IP,
SocketOptionName.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.google.c om...
"PHLICS_Admin" <ph****@hotmail.com> wrote in message

news:<OD**************@TK2MSFTNGP12.phx.gbl>...
this._clsMCastReceiver.SetSocketOption(SocketOptio nLevel.IP,
SocketOptionName.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._clsMCastReceiver = new Socket(AddressFamily.InterNetwork,
SocketType.Dgram, ProtocolType.Udp);
IPEndPoint ipep=new IPEndPoint(IPAddress.Any , CIMSys.MCastPort);
this._clsMCastReceiver.Bind(ipep);
IPAddress ip=IPAddress.Parse(CIMSys.MCastIPAddress);

this._clsMCastReceiver.SetSocketOption(SocketOptio nLevel.IP,
SocketOptionName.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_Admin" <ph****@hotmail.com> wrote in message
news:O3**************@TK2MSFTNGP09.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
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...
7
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...
1
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...
2
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...
0
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...
3
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...
2
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. ...
5
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....
0
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...
0
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,...
0
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...
0
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,...
1
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
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...
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.