2011-03-11 68 views
0

我有一個連接到.net網絡服務的asp.net應用程序,只要我登錄&到達主頁面,web服務就會返回數據。當系統連接一段時間後系統出現網絡異常

但是,如果我登錄後可能超過1或2個小時,當我點擊任何一個鏈接,我得到的:

"System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: 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" 

什麼是定爲這?謝謝。

回答

0

這可能是因爲您的會話過期。在對該服務器進行任何調用之前,您必須檢查用戶是否仍連接到託管Web服務的Web服務器。

+0

沒有會話的概念,我不檢查會話。 – Sharpeye500 2011-03-11 08:12:59

+0

獲取該消息的一種方式是如果您假設您已經連接(如在會話中),而不是在每次通話之前始終連接到服務,那麼上面的答案是有效的 – zzzuperfly 2011-03-11 08:57:15