Windows CE ActiveSync TCP 连接
我有一个 .NET 紧凑框架程序,它让我的 CE 设备通过 USB 电缆的 ActiveSync 连接打开到我的 PC 的套接字。一切工作正常,除了当我尝试使用未连接到网络的笔记本电脑时。然后,CE 设备抛出一个带有 ErrorCode = 10061
的 SocketException
,我将其跟踪为 WSAECONNREFUSED -- Connection Beenrejected
错误。
经过一番调试后,我发现抛出异常是因为 DNS 查找(使用 System.Net.Dns.GetHostEntry)仅返回 Loopback...而且显然是 CE 设备没有运行服务器代码来接受连接...
所以,关于如何我可以的任何想法:a)欺骗我的计算机认为它在网络上,b)引用CE设备通过ActiveSync连接到的机器除了主机名之外的其他方式,或 c) 其他一些我还不知道的选项?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不要使用主机名来解析 PC。请改用“ppp-peer”。
Don't use the hostname to resolve the PC. Instead use 'ppp-peer'.