Android How to determine whether the ClientConnectionManager opened a new connection or used existing one?
<p>We created a class deriving from <code>DefaultHttpClient</code> and use a <code>ConnectionKeepAliveStrategy</code>. Now I'd like to know during runtime whether the <code>ClientConnectionManager</code> reused a connection or created a new one (for instance because the connection with the server timed out).</p>

<p>How can I tell?</p>

<pre><code>public class MyHttpClient extends DefaultHttpClient
{
    // some code setting constants

        public MyHttpClient()
        {
            super();

            // some code setting http connection params


            setKeepAliveStrategy(new ConnectionKeepAliveStrategy()
            {
                @Override
                public long getKeepAliveDuration(final HttpResponse response, final HttpContext context)
                {
                    return KEEP_ALIVE_TIMEOUT * MS_PER_SECOND;
                }
            });

        }

    @Override
    protected ClientConnectionManager createClientConnectionManager()
    {

        // some code registering HTTP and HTTPS 

        return new ThreadSafeClientConnManager(getParams(), registry);
    }       

    // some code for the socketfactory
}

// At some other class:

public class SomeClass
{
   private static final HttpClient HTTP_CLIENT = new MyHttpClient();

   public void someMethod()
   {
    /* some code */

    HttpGet get = new HttpGet(some url);
    HttpResponse getResponse = HTTP_CLIENT.execute(get);

    /* more code */
   }
}
</code></pre>

<p>When we call <code>HTTP_CLIENT.execute()</code> how can I see whether a new connection was created by the <code>ClientConnectionManager</code> or an existing connection was reused?</p>
