<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _call_connection_lost_and_clean_up(self, exc):
 """ Clean up all resources and call the protocols connection lost method. """


        self._state = _State.CLOSED
        try:
            self._protocol.connection_lost(exc)
        finally:
            self._rawsock.close()
            if self._tls_conn is not None:
                self._tls_conn.set_app_data(None)
                self._tls_conn = None
            self._rawsock = None
            self._protocol = None
            self._loop = None