mqtt_base.py 文件源码

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

项目:log-tick 作者: xxv 项目源码 文件源码
def connect(self):
        print("Connecting to {host}:{port}...".format(**self.mqtt_config))
        if 'ca_certs' in self.mqtt_config:
            self.mqtt.tls_set(self.mqtt_config['ca_certs'], tls_version=ssl.PROTOCOL_TLSv1_2)

        if 'user' in self.mqtt_config:
            self.mqtt.username_pw_set(self.mqtt_config['user'], self.mqtt_config['password'])
        self.mqtt.connect(self.mqtt_config['host'], self.mqtt_config['port'])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号