0
我在C#中编写了一个WinCE应用程序,该应用程序向驻留在我的网络上的APACHE服务器发出HTTP POST。由于一些网络问题(我猜测),我得到下面的异常在托管代码Wince异步HTTP请求的套接字异常
System.Net.Sockets.SocketException occurred
Message="A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond"
ErrorCode=10060
NativeErrorCode=10060
StackTrace:
at System.Net.Sockets.Socket.ConnectNoCheck(EndPoint remoteEP)
at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
at System.Net.Connection.doConnect(IPEndPoint ep)
at System.Net.Connection.connect(Object ignored)
at System.Threading.ThreadPool.WorkItem.doWork(Object o)
at System.Threading.Timer.ring()
此异常并不总是抛出,但是当它被抛出时,我的应用程序无法连接到服务器AT所有。重复的连接尝试无助于重新连接。唯一有帮助的是关闭和重新部署应用程序。
我无法捕捉到异常,因为它内部的托管代码。有什么办法可以绕过这个并关闭所有到我的服务器的套接字连接并重新初始化它们?有什么我做错了吗?
问题出在网络上。叹。谢谢 :) – Rishi