E
ElvisRS
Hi,
I'm writing a simple udp client using sockets. My code looks like
this:
initServer2 = new Socket(AddressFamily.InterNetwork, SocketType.Dgram,
ProtocolType.Udp);
initServer2.Connect(IPAddress.Parse(Properties.Settings.Default.InitServerAddress),
Properties.Settings.Default.InitServerPort);
initServer2.Send(Encoding.ASCII.GetBytes("REGISTER2PORT-" +
userName));
initServer2.Receive(buffer);
initServer2.Connect(IPAddress.Any, 0);
initServer2.Receive(buffer);
First I connect my socket to a specified ip and port, then I send and
receive data. next thing I want to do is opening the same socket that
it can accept every incoming package.
Everything works fine under Windows Vista, but when I run it under
Windows Xp I get an SocketException from line:
initServer2.Connect(IPAddress.Any, 0); that the requeste address is
not valid in its context: 0.0.0.0:0.
Someone knows what is wrong with that code?
Thanks for any help
I'm writing a simple udp client using sockets. My code looks like
this:
initServer2 = new Socket(AddressFamily.InterNetwork, SocketType.Dgram,
ProtocolType.Udp);
initServer2.Connect(IPAddress.Parse(Properties.Settings.Default.InitServerAddress),
Properties.Settings.Default.InitServerPort);
initServer2.Send(Encoding.ASCII.GetBytes("REGISTER2PORT-" +
userName));
initServer2.Receive(buffer);
initServer2.Connect(IPAddress.Any, 0);
initServer2.Receive(buffer);
First I connect my socket to a specified ip and port, then I send and
receive data. next thing I want to do is opening the same socket that
it can accept every incoming package.
Everything works fine under Windows Vista, but when I run it under
Windows Xp I get an SocketException from line:
initServer2.Connect(IPAddress.Any, 0); that the requeste address is
not valid in its context: 0.0.0.0:0.
Someone knows what is wrong with that code?
Thanks for any help