def _append(self, host, port):
    if (not isinstance(host, string_types)):
        err_msg = 'Host must be a string: invalid value: {0}'.format(host)
        self._logger.error(err_msg)
        raise TypeError(err_msg)
    if (not isinstance(port, (string_types, integer_types))):
        err_msg = 'Port must be an integer or a string: invalid value: {0}'.format(port)
        self._logger.error(err_msg)
        raise TypeError(err_msg)
    elif isinstance(port, string_types):
        try:
            port = int(port)
        except ValueError as e:
            err_msg = 'Port "{0}" is not a valid string: {1}'.format(port, e)
            self._logger.error(err_msg)
            raise ValueError(err_msg)
    if ((port < 0) or (port > 65535)):
        err_msg = 'Invalid port number: {0}'.format(port)
        self._logger.error(err_msg)
        raise ValueError(err_msg)
    self.address_deque.append(_AddressEntry(host=host, resolved=False, data=port))
def _append(self, host, port):
    if (not isinstance(host, string_types)):
        err_msg = 'Host must be a string: invalid value: {0}'.format(host)
        self._logger.error(err_msg)
        raise TypeError(err_msg)
    if (not isinstance(port, (string_types, integer_types))):
        err_msg = 'Port must be an integer or a string: invalid value: {0}'.format(port)
        self._logger.error(err_msg)
        raise TypeError(err_msg)
    elif isinstance(port, string_types):
        try:
            port = int(port)
        except ValueError as e:
            err_msg = 'Port "{0}" is not a valid string: {1}'.format(port, e)
            self._logger.error(err_msg)
            raise ValueError(err_msg)
    if ((port < 0) or (port > 65535)):
        err_msg = 'Invalid port number: {0}'.format(port)
        self._logger.error(err_msg)
        raise ValueError(err_msg)
    self.address_deque.append(_AddressEntry(host=host, resolved=False, data=port))