def METHOD_NAME(self, reason):
    if self.factory.server.pool_interface:
        log.msg(
            eventid="cowrie.proxy.client_disconnect",
            format="Lost connection with the pool backend: id %(vm_id)s",
            vm_id=self.factory.server.pool_interface.vm_id,
            protocol="ssh",
        )
    else:
        log.msg(
            eventid="cowrie.proxy.client_disconnect",
            format="Lost connection with the proxy's backend: %(honey_ip)s:%(honey_port)s",
            honey_ip=self.factory.server.backend_ip,
            honey_port=self.factory.server.backend_port,
            protocol="ssh",
        )
    self.transport.METHOD_NAME(reason)
    self.transport = None
    # if connection from frontend is not closed, do it here
    if self.factory.server.transport:
        self.factory.server.transport.loseConnection()