@classmethod
    def socket_connect(cls, host, port, queryport, password=None, timeout=None):
        """Connect to socket.

        Stores arguments on class variables to remember for reconnect.
        Closes socket if open.

        Returns:
            Bool, Error

        """
        if cls._socket:
            cls._socket.close()  # Reset socket in case this is a reconnect

        if timeout is None:
            timeout = socket.getdefaulttimeout()

        cls.socket_host = host
        cls.socket_port = port
        cls.socket_query_port = queryport
        cls.password = password
        cls.socket_timeout = timeout

        try:
            cls._socket = socket.create_connection((cls.socket_host, cls.socket_port), timeout)
        except socket.timeout as e:  ### NEEDS TESTING.
            return False, e
        except __HOLE__ as e:
            return False, e

        return True, None
dataset/ETHPy150Open f4ble/pyarc/ark/steam/steam_socket_core.py/SteamSocketCore.socket_connect