'Called when the connection has been inactive for
L{self.timeOut<twisted.protocols.policies.TimeoutMixin.timeOut>}
seconds. Cleanly tears the connection down, attempting to notify the
peer if needed.
We override this method to add two extra bits of functionality:
- We want to log the timeout.
- We want to send a GOAWAY frame indicating that the connection is
being terminated, and whether it was clean or not. We have to do this
before the connection is torn down.'

def timeoutConnection(self):

    self._log.info('Timing    out    client    {client}', client=self.transport.getPeer())
    if ((self.conn.open_outbound_streams > 0) or (self.conn.open_inbound_streams > 0)):
        error_code = h2.errors.ErrorCodes.PROTOCOL_ERROR
    else:
        error_code = h2.errors.ErrorCodes.NO_ERROR
    self.conn.close_connection(error_code=error_code)
    self.transport.write(self.conn.data_to_send())
    if (self.abortTimeout is not None):
        self._abortingCall = self.callLater(self.abortTimeout, self.forceAbortClient)
    self.transport.loseConnection()
