How long is a WCF connection held open?
<p>I'm running a small WCF client application that connects to an IIS server every few minutes to download data. There are about 500 of these clients for 2 or 3 servers, and my basic code is something like this:</p>

<pre><code>Client connection = null;

try
{
    connection = new Client();
    List&lt;TPointer&gt; objects = connection.GetList();

    // Some work on List&lt;T&gt;

    foreach (TPointer pointer in objects)
    {
        T data = GetDataFromStream(pointer, connection);

        // Some additional processing on T
    }

    connection.SendMoreData();    

    // More work
}
catch (...)
{
    // Exception handling for various exceptions
}
finally
{
    // Handle Close() or Abort()
    if (connection != null)
        connection.Close();
}
</code></pre>

<p>When I simulate running all the clients at once for large amounts of TPointers, I start encountering the following error:</p>

<blockquote>
  <p>System.TimeoutException: The request channel timed out while waiting for a reply after 00:01:00.</p>
</blockquote>

<p>That seems like one of those errors that can occur for any number of reasons. For all I know the server could just be swamped, or I could be requesting too large/too many objects and it's taking too long to download (a whole minute though?). Increasing the timeout is an option, but I'd like to understand the actual problem instead of fixing the symptom.</p>

<p><strong>Given I have no control over the server, how can I streamline my client?</strong> </p>

<ol>
<li><p>I'm not actually sure what the "request channel" mentioned in the timeout refers to. Does the timeout start ticking from when I create new Client() until I call <code>Client.Close()</code>? Or does each specific request I'm sending to the server (e.g. <code>GetList</code> or <code>GetData</code>) get another minute? Is it worth my while to close <code>Client()</code> in between each call to the server? (I'm hoping not... that would be ugly)</p></li>
<li><p>Would it be helpful to chunk up the amount of data I'm receiving? The <code>GetList()</code> call can be quite large (running into the thousands). I could try obtaining a few objects at a time and jobbing off the post-processing for later...</p></li>
</ol>

<p><strong>Edit:</strong></p>

<p>Since a few people mentioned streaming:</p>

<p>The <code>Client</code> binding uses <code>TransferMode.StreamedResponse</code>.
<code>GetDataFromStream()</code> uses a Stream derived from <code>TPointer</code>, and <code>SendMoreData()</code>'s payload size is more or less negligible.</p>

<p>Only <code>GetList()</code> actually returns a non-stream object, but I'm unclear as to whether or not that affects the method of transfer.</p>