Question

I have a .NET compact framework program that has my CE device open a socket to my PC over the USB cable's ActiveSync connection. Everything works fine, except when I'm trying to use a laptop that isn't connected to a network. Then the CE device throws a SocketException with an ErrorCode = 10061, which I tracked down as a WSAECONNREFUSED -- Connection refused error.

After a bit of debugging, I discovered that the exception was being thrown because the DNS lookup (using System.Net.Dns.GetHostEntry) was only returning a Loopback... and, obviously, the CE device isn't running the server code to accept the connection...

So, any ideas on how I could: a) trick my computer into thinking it's on a network, b) reference the machine a CE device is connected to via ActiveSync in a manner other than by its hostname, or c) some other option I don't know about yet?

Was it helpful?

Solution

Don't use the hostname to resolve the PC. Instead use 'ppp-peer'.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top