public override long getKeepAliveDuration(HttpResponse response, HttpContext context) { HeaderElementIterator it = new BasicHeaderElementIterator(response.headerIterator(HTTP.CONN_KEEP_ALIVE)); while (it.hasNext()) { HeaderElement he = it.nextElement(); string param = he.Name; string value = he.Value; if (!string.ReferenceEquals(value, null) && param.Equals("timeout", StringComparison.CurrentCultureIgnoreCase)) { try { return long.Parse(value) * 1000; } catch (System.FormatException) { } } } return keepAliveTimeOut * 1000; }