title: How can I diagnose a WSAECONNREFUSED error on Windows CE?
body: <p>I have a Dell Axim Windows CE device (Windows Mobile 5.0 OS 5.1.1702 Build 14366.1.0.1) connected to a Dell Latitude E6500 laptop. My C++ application is running on the CE device and listening for TCP connections on port 80. The program tries to connect to itself using the address 169.254.2.1:80, and gets error code WSAECONNREFUSED (10061). This generally indicates that nobody is listening on that port. If I change the address to 127.0.0.1:80, the connection succeeds.</p>
  
  <p>Here's the weird part. If I disconnect the device from that laptop and connect it to a Dell Latitude D830, everything works properly. The 169.254.2.1 address is the same, but connecting to it succeeds. Note that this is the application running on the CE device <em>connecting to itself</em>, not connecting to the laptop, nor is it the laptop connecting to the application on the device. We have confirmed this with a few different machines - all of the E6500's show the problem, nothing else does. </p>
  
  <p>I don't understand how which machine the device is connected to affects internal TCP connections. Any ideas?</p>