2013-12-23 48 views
0

我正在使用WCF雙工通道進行服務回調交互,另外我在另一個端口上使用另一個服務。經過一段時間後,雙工通道出現故障,但是當我嘗試使用它時,我收到通信異常(我不知道通道何時發生故障,我無法使用SessionFaulted事件)。接收超時是無限的,setTimeout是30秒。使用雙工通道的未處理通信異常

問題是我找不到處理此異常的方法,沒有堆棧跟蹤,我無法在任何地方捕獲它。

我用診斷/錯誤處理行爲擴展來調查,但沒有運氣。

例外:

2013-12-23 11:00:34,514 ERROR General - An exception was thrown during a service call. 
Details: System.ServiceModel.CommunicationException: The socket connection was aborted. 
This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. 
Local socket timeout was '10675199.02:48:05.4775807'. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine 
    at System.ServiceModel.Channels.SocketConnection.HandleReceiveAsyncCompleted() 
    at System.ServiceModel.Channels.SocketConnection.OnReceiveAsync(Object sender, SocketAsyncEventArgs eventArgs) 
    --- End of inner exception stack trace --- 
    at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result) 
    at System.ServiceModel.Channels.TransportDuplexSessionChannel.TryReceiveAsyncResult.End(IAsyncResult result, Message& message) 
    at System.ServiceModel.Channels.TransportDuplexSessionChannel.EndTryReceive(IAsyncResult result, Message& message) 
    at System.ServiceModel.Dispatcher.DuplexChannelBinder.EndTryReceive(IAsyncResult result, RequestContext& requestContext) 
    at System.ServiceModel.Dispatcher.ErrorHandlingReceiver.EndTryReceive(IAsyncResult result, RequestContext& requestContext) 

任何想法?

回答

0

經過長時間的研究以及我沒有其他選擇後,我決定比較舊回調和新回調的引用,如果它們不同,則替換舊回調。

對方接到故障後將關閉它的一側。

這不是最好的解決方案,因爲它有點剎車通信合同,但它做的工作。