0
我正在開發與地秤連接的WCF服務。 我們希望在重量發生變化時向所有連接的客戶端發送消息。 一個地磅只能連接一個客戶端,所以我開發了WCF,它通過wsDualHttpBinding和回調與客戶端進行通信。WCF wsDualHttpBinding停止發送回調
此解決方案的工作原理,但長時間(1-2天)WCF服務停止發送回調。 我知道我的服務工作,因爲我有記錄器 - 但我的客戶沒有收到回調。我的服務也不會拋出異常。
這是我的服務pseduo代碼
[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Reentrant, InstanceContextMode = InstanceContextMode.PerSession)]
public sealed class WeightbridgeService : IWeightbridgeService, IDisposable
public WeightbridgeService()
{
this.callback = OperationContext.Current.GetCallbackChannel<IWeightbridgeServiceCallback>();
weighbridge.WeightChanged += WeightChangedEventHandler;
timer.Elapsed += TimerOnElapsed;
timer.Start();
}
private void TimerOnElapsed(object sender, ElapsedEventArgs elapsedEventArgs)
{
timer.Stop();
this.callback.SendWeightData(this.weightData);
timer.Start();
}
和配置
<bindings>
<wsDualHttpBinding>
<binding name="longTimeoutBinding" receiveTimeout="00:45:00" sendTimeout="00:45:00" openTimeout="00:45:00" closeTimeout="00:45:00" >
<reliableSession inactivityTimeout="00:45:00" />
<security mode="None"/>
</binding>
</wsDualHttpBinding>
</bindings>
你能幫我什麼,我做錯了? 我找不到解決方案。