【发布时间】:2011-05-18 09:29:00
【问题描述】:
我们通过 netTcpBinding 使用可靠会话进行 wcf 发布/订阅设置,并且在发布服务和订阅服务都托管在控制台应用程序中的一台机器上,我们收到上述错误。这台机器在一个工作组中。我们部署机器的其他任何地方都在域中,并且工作正常。我对 wcf 的了解有些有限,这只是交给我,所以请耐心等待。有人对如何解决此错误有任何建议吗?
完整的例外如下:
System.ServiceModel.CommunicationException 套接字连接被中止。这可能是由于处理您的消息时出错或远程主机超出接收超时,或者是潜在的网络资源问题引起的。本地套接字超时为“10675199.02:48:05.4775807”。
在 System.ServiceModel.Channels.SocketConnection.EndRead() 在 System.ServiceModel.Channels.DelegatingConnection.EndRead() 在 System.ServiceModel.Channels.TracingConnection.EndRead() 在 System.ServiceModel.Channels.ConnectionStream.ReadAsyncResult.HandleRead() 在 System.ServiceModel.Channels.ConnectionStream.ReadAsyncResult.OnAsyncReadComplete(对象状态) 在 System.ServiceModel.Channels.TracingConnection.TracingConnectionState.ExecuteCallback() 在 System.ServiceModel.Channels.SocketConnection.FinishRead() 在 System.ServiceModel.Channels.SocketConnection.AsyncReadCallback(布尔 hasResult,Int32 错误,Int32 bytesRead) 在 System.ServiceModel.Diagnostics.Utility.IOCompletionThunk.UnhandledExceptionFrame(UInt32 错误,UInt32 字节读取,NativeOverlapped* nativeOverlapped) 在 System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 错误代码,UInt32 numBytes,NativeOverlapped* pOVERLAP) 内部异常:
System.Net.Sockets.SocketException
现有连接被远程主机强行关闭
在 System.ServiceModel.Channels.SocketConnection.EndRead() 在 System.ServiceModel.Channels.DelegatingConnection.EndRead() 在 System.ServiceModel.Channels.TracingConnection.EndRead() 在 System.ServiceModel.Channels.ConnectionStream.ReadAsyncResult.HandleRead() 在 System.ServiceModel.Channels.ConnectionStream.ReadAsyncResult.OnAsyncReadComplete(对象状态) 在 System.ServiceModel.Channels.TracingConnection.TracingConnectionState.ExecuteCallback() 在 System.ServiceModel.Channels.SocketConnection.FinishRead() 在 System.ServiceModel.Channels.SocketConnection.AsyncReadCallback(布尔 hasResult,Int32 错误,Int32 bytesRead) 在 System.ServiceModel.Diagnostics.Utility.IOCompletionThunk.UnhandledExceptionFrame(UInt32 错误,UInt32 字节读取,NativeOverlapped* nativeOverlapped) 在 System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
我的绑定配置如下:
<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" />
【问题讨论】:
-
通信的另一端发生了一些事情,因此您应该启用跟踪(可能在客户端和服务器上)以查看是否存在解释问题的异常。 msdn.microsoft.com/en-us/library/ms733025.aspx
标签: wcf