How can I set the receiveTimeout and sendTimeout to infinity with this WCF contact?

Use infinite for the various timeout values - close, open, receive, and send. You specify these timeouts in a binding configuration like so.

<bindings>
    <netNamedPipeBinding>
        <binding name="mybinding" closeTimeout="infinite" openTimeout="infinite"
            receiveTimeout="infinite" sendTimeout="infinite" />
    </netNamedPipeBinding>
</bindings>

The bindings section goes at the same level as the services and behaviors sections. The only thing left is to reference the binding configuration in your service endpoint.

<services>
  <service name="DCC_Service.DCCService" behaviorConfiguration="serviceBehavior">
    <endpoint binding="netNamedPipeBinding"
        contract="DCC_Service.IDCCService"
        address="DCCService"
        bindingConfiguration="mybinding"/>         <!-- SEE THIS LINE -->
    <endpoint binding="mexNamedPipeBinding"
        contract="IMetadataExchange"
        address="mex" />
    <host>
      <baseAddresses>
        <add baseAddress="net.pipe://localhost/"/>
      </baseAddresses>
    </host>
  </service>
</services>

<behaviors>
  <serviceBehaviors>
    <behavior name="serviceBehavior">
      <serviceMetadata httpGetEnabled="false"/>
    </behavior>
  </serviceBehaviors>
</behaviors>

I don't remember specifically (and I don't have time to look right now), but you may have to put this stuff in your client configuration as well.


Set it as max timespan which is 10675199.02:48:05.4775807

sendTimeout="10675199.02:48:05.4775807"

You can also give maximum time out like below

{

            binding.CloseTimeout = TimeSpan.MaxValue;

            binding.OpenTimeout = TimeSpan.MaxValue;

            binding.ReceiveTimeout = TimeSpan.MaxValue;

            binding.SendTimeout = TimeSpan.MaxValue;

}