gpt4 book ai didi

wcf - 远程主机使用 WCF 强制关闭现有连接

转载 作者:行者123 更新时间:2023-12-04 08:29:19 27 4
gpt4 key购买 nike

我们通过 netTcpBinding 使用可靠 session 进行了 wcf 发布/订阅设置,并且在一台机器上,发布服务和订阅服务都托管在控制台应用程序中,我们收到上述错误。这台机器在一个工作组中。我们部署机器的其他任何地方都在域中,并且工作正常。我对 wcf 的了解有些有限,这只是交给我,所以请耐心等待。有人对如何解决此错误有任何建议吗?

完整的异常(exception)如下:

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'.
at System.ServiceModel.Channels.SocketConnection.EndRead() at System.ServiceModel.Channels.DelegatingConnection.EndRead() at System.ServiceModel.Channels.TracingConnection.EndRead() at System.ServiceModel.Channels.ConnectionStream.ReadAsyncResult.HandleRead() at System.ServiceModel.Channels.ConnectionStream.ReadAsyncResult.OnAsyncReadComplete(Object state) at System.ServiceModel.Channels.TracingConnection.TracingConnectionState.ExecuteCallback() at System.ServiceModel.Channels.SocketConnection.FinishRead() at System.ServiceModel.Channels.SocketConnection.AsyncReadCallback(Boolean haveResult, Int32 error, Int32 bytesRead) at System.ServiceModel.Diagnostics.Utility.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped) at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP) Inner exception:
System.Net.Sockets.SocketException
An existing connection was forcibly closed by the remote host
at System.ServiceModel.Channels.SocketConnection.EndRead() at System.ServiceModel.Channels.DelegatingConnection.EndRead() at System.ServiceModel.Channels.TracingConnection.EndRead() at System.ServiceModel.Channels.ConnectionStream.ReadAsyncResult.HandleRead() at System.ServiceModel.Channels.ConnectionStream.ReadAsyncResult.OnAsyncReadComplete(Object state) at System.ServiceModel.Channels.TracingConnection.TracingConnectionState.ExecuteCallback() at System.ServiceModel.Channels.SocketConnection.FinishRead() at System.ServiceModel.Channels.SocketConnection.AsyncReadCallback(Boolean haveResult, Int32 error, Int32 bytesRead) at System.ServiceModel.Diagnostics.Utility.IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped) at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)



我的绑定(bind)配置如下:
<netTcpBinding>
<binding name="NetTcpBinding_ISubscriptionService"
closeTimeout="00:01:00"
openTimeout="00:01:00"
receiveTimeout="00:10:00"
sendTimeout="00:01:00"
transactionFlow="false"
transferMode="Buffered"
transactionProtocol="OleTransactions"
hostNameComparisonMode="StrongWildcard"
listenBacklog="10"
maxBufferPoolSize="524288"
maxBufferSize="65536"
maxConnections="10"
maxReceivedMessageSize="65536">
<readerQuotas maxDepth="32"
maxStringContentLength="8192"
maxArrayLength="524288"
maxBytesPerRead="4096"
maxNameTableCharCount="16384" />
<reliableSession ordered="true"
inactivityTimeout="00:10:00"
enabled="true"/>
<security mode="Transport"
transport=""
clientCredentialType="Windows"
protectionLevel="EncryptAndSign"
message=""/>
</binding>
</netTcpBinding>

端点是:
<endpoint address="net.tcp://localhost:8000/SubscriptionService"
binding="netTcpBinding"
bindingConfiguration="NetTcpBinding_ISubscriptionService"
contract="SubscriptionService.ISubscriptionService"
name="NetTcpBinding_ISubscriptionService" />

最佳答案

好的,我发现了我的问题所在。

客户端应用程序连接到的服务的 mxConnection 为 10。我们还使用 SecureMessaging,listenBacklog 为 1。将 maxConnections 修改为 100,将 listBacklog 修改为 200,一切正常。

关于wcf - 远程主机使用 WCF 强制关闭现有连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6042539/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com