簡體   English   中英

當客戶端在超時時斷開連接時,WCF ServiceHost會崩潰,導致單聲道崩潰

[英]WCF ServiceHost crashes mono when client disconnects on timeout

當客戶端在超時后斷開連接,然后服務器嘗試返回結果時,出現以下錯誤:-

System.ArgumentException:值不在預期范圍內。 在(包裝器托管到本機)System.Object .__ icall_wrapper_mono_delegate_end_invoke(對象,intptr)在(包裝器委托結束調用).end_invoke_bool__this ___ Message&_IAsyncResult(System.ServiceModel.Channels.Message&,System.IAsyncResults)在System.ServiceModel.Channel / Users / builder / data / lanes / 5533 / mono-mac-sdk / external / bockbuild / builds / mono-x64 / mcs中的DuplexChannelBase.EndTryReceive(System.IAsyncResult結果,System.ServiceModel.Channels.Message&消息)[0x00000] / Users / builder / data / lanes / 5533 / mono中的/class/System.ServiceModel/System.ServiceModel.Channels/DuplexChannelBase.cs:196位於System.ServiceModel.Dispatcher.ListenerLoopManager.TryReceiveDone(System.IAsyncResult結果)[0x0000c] -mac-sdk / external / bockbuild / builds / mono-x64 / mcs / class / System.ServiceModel / System.ServiceModel.Dispatcher / ChannelDispatcher.cs:596((包裝托管到本地)System.Runtime.Remoting.Messaging System.Runtime.Remoting.Messaging上的.AsyncResult.Invoke(System.Runtime.Remoting.Messaging.AsyncResult)。 / Users / builder / data / lanes / 5533 / mono-mac-sdk / external / bockbuild / builds / mono-x64 / mcs / class / corlib / System中的AsyncResult.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()[0x00000]。 System.Threading.ThreadPoolWorkQueue.Dispatch()中的Runtime.Remoting.Messaging / AsyncResult.cs:210()[0x00074]在/ Users / builder / data / lanes / 5533 / mono-mac-sdk / external / bockbuild / builds / mono- x64 / mcs / class / referencesource / mscorlib / system / threading / threadpool.cs:856,位於/ Users / builder / data / lanes / 5533 / mono-mac-sdk /中的System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()[0x00000]外部/ bockbuild /建立/單X64 / MCS /類/ referencesource / mscorlib程序/系統/線程/ threadpool.cs:1211

該錯誤通常表示與該客戶端通信的通道有錯誤,然后服務器嘗試與該通道通信,例如, 聊天應用程序

當我們使用WCF雙工模式時。 你可以用

Channel.Closing+=new EventHandler(Channel_Closing)

聆聽客戶的狀態。

我建議您使用心跳數據包指示客戶端狀態,然后處理錯誤/處理邏輯。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM