【发布时间】:2026-02-04 17:25:01
【问题描述】:
我们在中间层使用托管在 IIS 上的 WCF 服务并使用 WPF 客户端。 我们在生产日志中看到了这些错误。从谷歌我被指向一个链接http://kennyw.com/indigo/150,它清楚地表明这个错误与 MaxConcurrentSessions 有关。
下面的生产日志详细信息表明,当 WPF 客户端尝试使用 ICommunicationObject.Open() 打开 WCF 代理连接时会发生错误 我们的生产系统上的这个错误经常发生,但我无法在我的本地设置上重现这个错误。我尝试将 MaxConcurrentSessions 更改为 1,然后打开 WPF 应用程序的 5 个实例,在 WPF 应用程序上,默认仪表板每 1 分钟运行一次计时器以尝试获取数据,但我仍然无法重现此错误。
我的问题实际上是这个错误何时发生,从上面的链接中它说当服务器压力过大时会发生这种情况,但在我上面的测试用例中它应该已经加载。我还需要能够重现此问题才能尝试修复。
如果我在正确的道路上的任何想法,MaxConcurrentSessions 是否是正确的查看位置以及我如何在本地模拟它。请帮忙。
2/16/2012 4:10:40 PM:Information:Exception in the ServiceCall constructor: 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 '00:00:59.9687730'. --->System.Net.Sockets.SocketException:
An existing connection was forcibly closed by the remote host at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) at System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)
--- End of inner exception stack trace ---
Server stack trace:
at System.ServiceModel.Channels.SocketConnection.ReadCore(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)
at System.ServiceModel.Channels.SocketConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
at System.ServiceModel.Channels.DelegatingConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
at System.ServiceModel.Channels.ConnectionUpgradeHelper.InitiateUpgrade (StreamUpgradeInitiator upgradeInitiator, IConnection& connection, ClientFramingDecoder decoder, IDefaultCommunicationTimeouts defaultTimeouts, TimeoutHelper& timeoutHelper)
at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.SendPreamble(IConnection connection, ArraySegment`1 preamble, TimeoutHelper& timeoutHelper)
at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.DuplexConnectionPoolHelper.AcceptPooledConnection(IConnection connection, TimeoutHelper& timeoutHelper)
at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
【问题讨论】:
标签: wcf wcf-client