def METHOD_NAME(self, timeout: Optional[float] = None):
    # Called by HttpProtocol at the end of connection_task
    # If we've upgraded to websocket, we do our own closing
    if self.websocket is not None:
        # Note, we don't want to use websocket.close()
        # That is used for user's application code to send a
        # websocket close packet. This is different.
        self.websocket.end_connection(1001)
    else:
        super().METHOD_NAME()