title: WCF prevent NetNamedPipeBinding Timeout
body: <p>I have created a simple client-service setup for downloading applications from a server. The client creates a NetNamedPipeBinding and uses this to open a channel with the service to initiate the download process. </p>
  
  <pre><code>private void OpenServiceChannel()
      {            
          InstanceContext instanceContext = new InstanceContext(this);
  
          NetNamedPipeBinding binding = new NetNamedPipeBinding();
  
          DuplexChannelFactory&lt;ICloudProductService&gt; duplexChannelFactory = new DuplexChannelFactory&lt;ICloudProductService&gt;(instanceContext, binding, new EndpointAddress(ADDRESS));
  
          _proxy = duplexChannelFactory.CreateChannel();
      }
  </code></pre>
  
  <p>The service then uses a Callback on the same channel to report progress to the client. This callback is defined as a part of the ServiceContract:</p>
  
  <pre><code>[ServiceContract(CallbackContract = typeof(IStatusProgressCallback))]
  public interface ICloudProductService
  {
  
      [OperationContract]
      [FaultContract(typeof(ServiceErrorCode))]
      Task&lt;IEnumerable&lt;LauncherAppDetails&gt;&gt; GetAvailableApps(string tokenJson);
  
      [OperationContract]
      [FaultContract(typeof(ServiceErrorCode))]
      Task Install(string tokenJson, LauncherAppDetails app);
  }
  </code></pre>
  
  <p>With the event in said callback triggered by the Service when it needs to increment the download progress</p>
  
  <pre><code>public interface IStatusProgressCallback
  {
  
      [OperationContract]
      void OnProgressUpdated(InstallProgress progress);
  
  }
  </code></pre>
  
  <p>This all works beautifully on any half decent internet connection as the downloads are pretty fast. My issue is that on slow connections, the download is taking longer than the 1 minute default timeout for the binding. I could increase the timeout of this binding but I am concerned that this is not an ideal solution as it is bad practice due to possible security/performance issues.</p>
  
  <p>Is there a way of configuring the binding on the client side so that the timeout period is refreshed on each successful callback (a keep-alive) such that as long as the server is passing incremental download progress, the connection will not time out.</p>