uwe.kl

uwe.kl

  • NA
  • 3
  • 0

Socket.Bind: Exception on PC's with different IP-Addresses.

Aug 18 2004 1:25 AM
Hi, I have the following problem. I hope that this is the right section to post it. I need to create a udp socket and i do it the following way. Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); IPEndPoint ipep = new IPEndPoint(IPAddress.Any,11000); socket.Bind(ipep); Everything works fine when I compile the program. Even the compiled EXE runs on the PC it was compiled on. But when I move the EXE to another machine, I get a exception. When I change the IPAddress to the address of the machine the EXE was compiled on, everything works fine again. For now I help myself with a config file and code like this: (the ip is from the config file). IPEndPoint ipep = new IPEndPoint(IPAddress.Parse("192.168.9.3",11000); socket.Bind(ipep); So, what happend? Is the IPAddress.Any statical binded during the compilation, do I have to set some compiler switches? I tried the same with an TCP-Connection (async and non async). The result was the same. Thanks in advance, Uwe.