none
netTcpBinding connection refused RRS feed

  • Question

  • I have a netTcpBinding WCF Windows service that has on average 65 clients connected at any one time.
    At some point client get a "connection refused" error.
    On the server while running "Resource Monitor" we see that at least one client has an unusually high "Send(B/sec)", when that client is restarted the other clients can now connect.

    Here is my Server app.config:

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <configSections>
        </configSections>
        <connectionStrings>
            <add name="ConnectService.Properties.Settings.SpeechQConnectionString"
                connectionString="Data Source=172.21.192.153;Initial Catalog=SpeechQ;Persist Security Info=True;User ID=***;Password=***"
                providerName="System.Data.SqlClient" />
        </connectionStrings>
        <system.serviceModel>
          <services>
            <service behaviorConfiguration="ConnectService.Service1Behavior"
                    name="ConnectService.LHCC">
              <endpoint address="" binding="netTcpBinding"   bindingConfiguration="tcp_Unsecured" contract="ConnectService.ILHCC">
                <identity>
                  <dns value="localhost" />
                </identity>
              </endpoint>
              <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" />
            
            </service>
          </services>
          <bindings>
            <netTcpBinding>
              <binding name="tcp_Unsecured">
                <security mode="None" />
              </binding>
            </netTcpBinding>
          </bindings>

          <behaviors>
            <serviceBehaviors>
              <behavior name="ConnectService.Service1Behavior">
                <serviceThrottling maxConcurrentCalls="100" maxConcurrentSessions="100"
                  maxConcurrentInstances="100" />
                <serviceDebug includeExceptionDetailInFaults="true" />
                <serviceMetadata />
              </behavior>
              <behavior name="ConnectService.LHCCBehavior">
               
                <serviceDebug includeExceptionDetailInFaults="false" />
              </behavior>
            </serviceBehaviors>
          </behaviors>
        </system.serviceModel>
      <appSettings>
        <add key="ConnectServerIP" value="172.21.195.84" />
        <add key="LookUpPort" value="1337" />
        <add key="SFTPPort" value="22" />
      </appSettings>
    </configuration>
    Wednesday, October 26, 2016 2:58 PM

All replies

  • Hi Peter,

    >> while running "Resource Monitor" we see that at least one client has an unusually high "Send(B/sec)",

    Do you mean this issue exist under this method? If so, it would be helpful if  you could share us your method code. I suggest you try Configuring Tracing to check the exception in Service side.

    For long request, I suggest you increase the time out for netTcpBinding include the maxConnections.

    <bindings>
      <netTcpBinding>
        <binding 
                 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="16384"
                        maxBytesPerRead="4096" 
                        maxNameTableCharCount="16384" />
          <reliableSession ordered="true" 
                           inactivityTimeout="00:10:00"
                           enabled="false" />
          <security mode="Transport">
            <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
          </security>
        </binding>
      </netTcpBinding>
    </bindings>
    

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, October 27, 2016 7:26 AM