2011-05-18 111 views
8

我们必须使用通过NetTcpBinding的一体机在哪里都发布服务和订阅服务正在于我们​​得到了一个控制台应用程序托管可靠的会话一个WCF的pub/sub设置关闭以上错误。这台机器在一个工作组中。我们在其他地方部署了该机器在一个域中并且工作正常。我对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(布尔haveResult,的Int32错误,的Int32 bytesRead) 在System.ServiceModel.Diagnostics.Utility.IOCompletio nThunk.UnhandledExceptionFrame(UInt32的误差,UInt32的bytesRead,NativeOverlapped * nativeOverlapped) 在System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32的的errorCode,UInt32的的numBytes,NativeOverlapped * pOVERLAP) 内部异常:
System.Net.Sockets.SocketException
的现有连接被强行关闭远程主机
在System.ServiceModel.Channels.SocketConnection.EndRead() 在System.ServiceModel.Channels.DelegatingConnection.EndRead() 在System.ServiceModel.Channels.TracingConnection.EndRead() 在System.ServiceMo System.ServiceModel.Channels.ConnectionStream.ReadAsyncResult.HandleRead() del.Channels.ConnectionStream.ReadAsyncResult.OnAsyncReadComplete在System.ServiceModel.Channels.SocketConnection(对象状态) 在System.ServiceModel.Channels.TracingConnection.TracingConnectionState.ExecuteCallback() 在System.ServiceModel.Channels.SocketConnection.FinishRead() .AsyncReadCallback(布尔haveResult,的Int32错误,的Int32 bytesRead) 在System.ServiceModel.Diagnostics.Utility.IOCompletionThunk.UnhandledExceptionFrame(UInt32的误差,UInt32的bytesRead,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" /> 
+0

通讯的另一端发生了某种情况,因此您应该启用跟踪(可能在客户端和服务器上)以查看是否存在解释问题的异常。 http://msdn.microsoft.com/en-us/library/ms733025.aspx – carlosfigueira 2011-05-18 13:46:22

回答

3

好吧,我发现我的问题是什么。

客户端应用程序被连接到了10 mxConnection服务。我们也使用SecureMessaging,并有一个listenBacklog为1.修正maxConnections为100和listBacklog为200,它都可以正常工作。

2

对我来说,问题是我没有正确的服务参考(从开发机器到生产机器)。

+0

我也是。尴尬,呵? :) – Kyle 2012-02-21 18:55:50

相关问题