Map.py 文件源码

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

项目:IPDC 作者: yenkuanlee 项目源码 文件源码
def Publish(self, target, channel, message):
                client = mqtt.Client()
                #client.on_publish = self.on_publish
        client.max_inflight_messages_set(200000)
                client.connect(target, 1883)
        client.loop_start()
                msg_info = client.publish(channel, message, qos=1)
        if msg_info.is_published() == False:
            msg_info.wait_for_publish()
        client.disconnect()
        #time.sleep(0.01)
        print "MAP MQTT IS PUBLISH : "+str(msg_info.is_published())
        print "MAP MQTT IP : "+target
        print "MAP MQTT MESSAGE : "+message
        print ""
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号