Anand Thangappan
Anand Thangappan

Reputation: 3106

WCF + net.tcp Communication Timeout problem

I have some critical problem in my project. During transaction time with (wcf + netTCP) I was getting the exception is.

The communication object, 
System.ServiceModel.Channels.ClientFramingDuplexSessionChannel, 
cannot be used for communication because it is in the Faulted state.

In WCF service app.config add binding tag with timeout specification. But my transaction has been ended within 10 min. what was the problem..

 <bindings>
      <basicHttpBinding>
        <binding name="ServiceSoap" closeTimeout="0:01:00" openTimeout="0:01:00" receiveTimeout="10:00:00" sendTimeout="10:00:00" allowCookies="false"
          bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
          maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
          messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
          useDefaultWebProxy="true">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None"
              realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
      </basicHttpBinding>
      <netTcpBinding>
        <binding name="b1" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="infinite" sendTimeout="10:00:00"

transferMode="Buffered"

maxBufferPoolSize="524288"

maxBufferSize="65536"

maxConnections="10"

maxReceivedMessageSize="65536">
          <security mode="None" />
        </binding>
      </netTcpBinding>
    </bindings>

Any one help me !!!..

Upvotes: 0

Views: 8354

Answers (3)

Jon Mitchell
Jon Mitchell

Reputation: 3429

I'm not sure why you think its a timeout issue? The error message doesn't suggest a timeout has ocured. Could the server be throwing an exception?

I would strongly recommend setting up WCF tracing. Its a bit involved but really worth doing as I've solved many obscure WCF issue with it.

Upvotes: 4

BrandonZeider
BrandonZeider

Reputation: 8152

Try adding this to your netTcpBinding:

<reliableSession inactivityTimeout="infinite" enabled="true" />

And if that doesn't work, enable WCF tracing to find out what's killing it.

Upvotes: 2

Filip
Filip

Reputation: 652

This is not a complete answer but if you are using the client + server on the same machine you can use a named-pipe binding instead of netTcp

The binding section the configurations might look like this.

<netNamedPipeBinding>
  <binding name="infiniteOpenBindingConfig" receiveTimeout="infinite" closeTimeout="infinite">
  </binding>
</netNamedPipeBinding>

To keep the binding alive indefinitely the configuration above must be set both on server and client.

Upvotes: 2

Related Questions