

def close_connection(self, error_code=0):
    '\n        Close a connection, emitting a GOAWAY frame.\n\n        :param error_code: (optional) The error code to send in the GOAWAY\n            frame.\n        :returns: Nothing\n        '
    self.state_machine.process_input(ConnectionInputs.SEND_GOAWAY)
    f = GoAwayFrame(0)
    f.error_code = error_code
    f.last_stream_id = self.highest_inbound_stream_id
    self._prepare_for_sending([f])

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