Hi folks,
I have a problem with the following example:
################################################## ####
My Receiver Class
*****************
class UdpReceiver
{
public static void Main()
{
UdpClient client = new UdpClient(10500);
client.JoinMulticastGroup(IPAddress.Parse("224.100 .0.1"));
Console.WriteLine("Waiting.....");
IPEndPoint iep = new IPEndPoint(IPAddress.Any, 0);
byte[] data = client.Receive(ref iep);
string stringData = Encoding.ASCII.GetString(data, 0,data.Length);
Console.WriteLine("received: {0}", stringData);
client.Close();
}
}
My Sender Class
******************
class UdpSender
{
public static void Main()
{
UdpClient sender = new UdpClient();
IPEndPoint iep = new
IPEndPoint(IPAddress.Parse("224.100.0.1"),10500);
byte[] data = Encoding.ASCII.GetBytes("This is a test message");
sender.Send(data, data.Length, iep);
sender.Close();
}
}
##################################################
Generally everything works fine, when sending messages from my sender
to the receiver until I have only a connection in my LAN.
When additionally connecting the server to the Internet by modem (DFÜ),
then the sender receives NO message any longer.
I really tried many diferent combinations of ip-Adresses and ports etc,
"played" with my network-settings of my LAN and DFÜ, but nothing works.
It seems that the messages of the sender are routed in the internet, but how
can
I avoid this?
I found many examples how to establish an UDP-connection between
client and server and all work .... UNTIL my modem comes up!!
It's really frustrating, because meanwhile I have no more ideas what I could
try to fix this.
Any help or hint is more than welcome
Thanx in advance
Frank