mqtt.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:chromecast-mqtt-connector 作者: nohum 项目源码 文件源码
def _internal_send_message(self, topic, payload, queue):
        self.logger.debug("sending topic %s with value \"%s\"" % (topic, payload))
        result = self.mqtt.publish(topic, payload, retain=True)

        if result == MQTT_ERR_NO_CONN and queue:
            self.logger.debug("no connection, saving message with topic %s to queue" % topic)
            self.queue.append([topic, payload])
        elif result[0] != MQTT_ERR_SUCCESS:
            self.logger.warn("failed sending message %s, mqtt error %s" % (topic, result))
            return False

        return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号