internal void Close() { State = HttpStates.CLOSED; _logger.DebugFormat( "{0} - Closing connection after {1} requests", this, requestCount); try { client.Close(); } catch (Exception) { } owner.RemoveClient(this); if (stream != null) { try { stream.Dispose(); } catch (ObjectDisposedException) { } } }