문제

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?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top