def __init__(self, cookies, max_retries=5, retry_backoff_base=2):
        self._max_retries = max_retries
        self._retry_backoff_base = retry_backoff_base

        self.on_connect = event.Event('Client.on_connect')
        """
        :class:`.Event` fired when the client connects for the first time.
        """

        self.on_reconnect = event.Event('Client.on_reconnect')
        """
        :class:`.Event` fired when the client reconnects after being
        disconnected.
        """

        self.on_disconnect = event.Event('Client.on_disconnect')
        """
        :class:`.Event` fired when the client is disconnected.
        """

        self.on_state_update = event.Event('Client.on_state_update')
        """
        :class:`.Event` fired when an update arrives from the server.

        Args:
            state_update: A ``StateUpdate`` message.
        """

        # http_utils.Session instance (populated by .connect()):
        self._session = None

        # Cookies required to initialize Session:
        self._cookies = cookies

        # channel.Channel instance (populated by .connect()):
        self._channel = None

        # Future for Channel.listen (populated by .connect()):
        self._listen_future = None

        self._request_header = hangouts_pb2.RequestHeader(
            # Ignore most of the RequestHeader fields since they aren't
            # required. Sending a recognized client_id is important because it
            # changes the behaviour of some APIs (eg. get_conversation will
            # filter out EVENT_TYPE_GROUP_LINK_SHARING_MODIFICATION without
            # it).
            client_version=hangouts_pb2.ClientVersion(
                client_id=hangouts_pb2.CLIENT_ID_WEB_HANGOUTS,
                major_version='hangups-{}'.format(version.__version__),
            ),
            language_code='en',
        )

        # String identifying this client (populated later):
        self._client_id = None

        # String email address for this account (populated later):
        self._email = None

        # Active client management parameters:
        # Time in seconds that the client as last set as active:
        self._last_active_secs = 0.0
        # ActiveClientState enum int value or None:
        self._active_client_state = None
def __init__ ( self , cookies , max_retries = 5 , retry_backoff_base = 2 ) : self . _max_retries = max_retries self . _retry_backoff_base = retry_backoff_base self . on_connect = event . Event ( 'Client.on_connect' ) self . on_reconnect = event . Event ( 'Client.on_reconnect' ) self . on_disconnect = event . Event ( 'Client.on_disconnect' ) self . on_state_update = event . Event ( 'Client.on_state_update' ) self . _session = None self . _cookies = cookies self . _channel = None self . _listen_future = None self . _request_header = hangouts_pb2 . RequestHeader ( client_version = hangouts_pb2 . ClientVersion ( client_id = hangouts_pb2 . CLIENT_ID_WEB_HANGOUTS , major_version = 'hangups-{}' . format ( version . __version__ ) , ) , language_code = 'en' , ) self . _client_id = None self . _email = None self . _last_active_secs = 0.0 self . _active_client_state = None
:class:`.Event` fired when the client connects for the first time.