

def _terminate_connection(self, error_code):
    '\n        Terminate the connection early. Used in error handling blocks to send\n        GOAWAY frames.\n        '
    f = GoAwayFrame(0)
    f.last_stream_id = self.highest_inbound_stream_id
    f.error_code = error_code
    self.state_machine.process_input(ConnectionInputs.SEND_GOAWAY)
    self._prepare_for_sending([f])

dataset/ETHPy150Open python-hyper/hyper-h2/h2/connection.py H2Connection._terminate_connection/original