473,563 Members | 2,747 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MultiCast send and receive on same XP machine?

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:893 2 and then a small MultiCast "client" that
sends out messages to this same address and port. The two work well
(the server displays the messages sent by the client) if the two are
running on separate machines.

However, if I run them both on my development machine the server
receives nothing? What am I missing? Your input would be highly
appreciated as I don't seem to be able to crack this one.

The important part of the listening "server" is:

---
IPAddress multiCastAddres s = IPAddress.Parse ("224.100.0.1") ;
int multiCastPort = 8932;

IPHostEntry ipHostInfo = Dns.Resolve(Dns .GetHostName()) ;
IPAddress localMultiCastA ddress=ipHostIn fo.AddressList[0];

IPEndPoint localMultiCastP oint = new IPEndPoint(loca lMultiCastAddre ss,
multiCastPort);

multiCastSocket = new Socket(AddressF amily.InterNetw ork,
SocketType.Dgra m, ProtocolType.Ud p);

multiCastSocket .SetSocketOptio n(SocketOptionL evel.Socket,
SocketOptionNam e.ReuseAddress, 1);

multiCastSocket .Bind(localMult iCastPoint);

MulticastOption multicastOption = new
MulticastOption (multiCastAddre ss,

localMultiCastA ddress);

multiCastSocket .SetSocketOptio n(SocketOptionL evel.IP,
SocketOptionNam e.AddMembership ,
multicastOption );

multiCastSocket .BeginReceive(b uffer, 0, 10240, 0,
new
AsyncCallback(S erver.MessageRe ceived),
null);
---

The important part of the sending "client" is:

---
IPAddress multiCastAddres s = IPAddress.Parse ("224.100.0.1") ;
int multiCastPort = 8932;

IPHostEntry ipHostInfo = Dns.Resolve(Dns .GetHostName()) ;
IPAddress localMultiCastA ddress=ipHostIn fo.AddressList[0];

multiCastSocket = new Socket(AddressF amily.InterNetw ork,
SocketType.Dgra m,
ProtocolType.Ud p);

MulticastOption multicastOption = new
MulticastOption (multiCastAddre ss,
localMultiCastA ddress);

multiCastSocket .SetSocketOptio n(SocketOptionL evel.IP,
SocketOptionNam e.AddMembership ,
multicastOption );

IPEndPoint multiCastEndPoi nt = new
IPEndPoint(mult iCastAddress,mu ltiCastPort);

while(true)
{
string msg="Message at "+DateTime.Now. Ticks.ToString( );
multiCastSocket .SendTo(Encodin g.ASCII.GetByte s(msg),multiCas tEndPoint);
Console.WriteLi ne("Sent message ["+msg+"] to "+multiCastAddr ess
.ToString()+":" +multiCastPort+ "...");
Thread.Sleep(10 00);
}

---

When composing this message I tried running both on the same machine
(but now on a different XP machine - not on my development machine)
and it seems to work there (and my development machine receives the
messages as well). But still doesn't work if I run both on my
development machine. Wonder if this is a Windows XP configuration
problem?

I would really like your input on this – I'm completely stuck and I'm
sure you can help me with this.

-Alfred
Nov 15 '05 #1
1 3339
I don't think this is in my code because now I have tried the same
thing using the samples that come with Visual Studio .NET 2003 for
MultiCastOption and they work together on other machines as well as
between machines. But not even those samples work running together
both on my development machine.

This is some configuration on my machine. Do you have any thoughts on
what configuration that could be? I have been looking over the network
configuration and can't see a difference between my development
machine and the other machines that the two samples work on?!?

Looking forward to hearing from you.
Nov 15 '05 #2

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

Similar topics

0
1477
by: Richard L Rosenheim | last post by:
I'm playing around with setting up a multicast socket. I can create a socket for sending, and I can one that receives. Is it possible to create one socket that can do both? The code I've been basing my work on is the code in "IP Multicasting in C#" by Gary Brewer, http://www.codeproject.com/csharp/multicast.asp). The following is the...
6
6486
by: PHLICS_Admin | last post by:
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...
2
530
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...
6
5629
by: Tom Kent | last post by:
I have a computer with two network cards (attached to seperate networks) and I am having trouble getting my C# application to send its multicast packets on a specific one. It receives just fine (I'm assuming because its listening to both networks), but it seems like it just picks the default to send over. I have implemented 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) ...
7
3552
by: DaTurk | last post by:
Hi, I'm trying to send a large number of messages to a UDP multicast group with which I have one client subscribed. But I'm losing mesages, and I'm not entirely sure why. I can't seem to find the reason, the asynch receive on the client doesn't even get called the corect number of times, which is 1000. I'm trying to send 1000 messages...
0
1157
by: zig158 | last post by:
My application will use a multicast channel for contacting peers on the network running the application, like mDNS. I have some sample code that works great on my local machine, but have a question how they will react on a multi router network. This code is currently 2 apps but will eventually be one multi thread app. This is the send...
1
4154
by: Jayme.Pechan | last post by:
I was working on a multicast client and ran into a possible problem. Here is the code... udpClient = new UdpClient(4000); udpClient.JoinMulticastGroup(IPAddress.Parse("224.1.1.1")); udpClient.BeginReceive(new AsyncCallback(DoUDPReceive), this); My concern is that it seems to make exclusive use of port 4000 so I worry that in a Citrix...
1
1407
by: Ryuke | last post by:
I have a code that receives gps information from nodes and gives off its own coordinates via radios connected by Ethernet. but the code continues to run after receiving only 1 set of coordinates, how do i get it to wait for multiple nodes to send before continuing
0
7664
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
7583
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
8106
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
7638
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...
0
7948
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...
0
6250
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
2082
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
1198
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
923
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.