当前位置: 首页 > news >正文

郴州市住房建设局门户网站中企动力做网站推广靠谱吗

郴州市住房建设局门户网站,中企动力做网站推广靠谱吗,wordpress管理后台 主题,wordpress博客价格1.MQTT(消息队列遥测传输协议),是一种基于 发布/订阅 (publish/subscribe)模式的"轻量级"通讯协议, 该协议构建于TCP/IP协议上 。MQTT最大优点在于,可以以极少的代码和有限的带宽&…

1.MQTT(消息队列遥测传输协议),是一种基于 发布/订阅 (publish/subscribe)模式的"轻量级"通讯协议, 该协议构建于TCP/IP协议上 。MQTT最大优点在于,可以以极少的代码和有限的带宽,为连接远程设备提供实时可靠的消息服务。作为一种低开销、低带宽占用的即时通讯协议,使其在物联网、小型设备、移动应用等方面有较广泛的应用。

MQTT协议中有三种身份:发布者(Publish)、服务器(Broker)、订阅者(Subscribe)

2.api操作:
Connect:与服务器进行MQTT连接;
Disconnect:与服务器断开MQTT连接;
Subscribe:订阅某个主题;
UnSubscribe:取消订阅某个主题;
Publish:发布消息;

3.安卓客户端示例:

添加依赖:

    implementation 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.2'implementation 'org.eclipse.paho:org.eclipse.paho.android.service:1.1.1'

添加权限

<uses-permission android:name="android.permission.INTERNET" />

java代码

//创建实例
//brokerUrl为实例,clientid是唯一值
MqttAndroidClient mqttAndroidClient = new MqttAndroidClient(context, brokerUrl, clientId);//设置监听订阅消息的回调mqttAndroidClient.setCallback(mqttCallback);mMqttConnectOptions = new MqttConnectOptions();//设置是否清除缓存mMqttConnectOptions.setCleanSession(true);//设置超时时间,单位:秒mMqttConnectOptions.setConnectionTimeout(60);//设置心跳包发送间隔,单位:秒mMqttConnectOptions.setKeepAliveInterval(60);//设置用户名mMqttConnectOptions.setUserName(userName);//设置密码mMqttConnectOptions.setPassword(password.toCharArray());//是否重连mMqttConnectOptions.setAutomaticReconnect(false);//同时发布的最大消息数量mMqttConnectOptions.setMaxInflight(10000);//建立连接mqttAndroidClient.connect(mMqttConnectOptions, null, iMqttActionListener);private final MqttCallback mqttCallback = new MqttCallback() {//这里处理收到的数据@Overridepublic void messageArrived(String topic, MqttMessage message) {}@Overridepublic void deliveryComplete(IMqttDeliveryToken arg0) {Log.d(TAG, "deliveryComplete: ");}@Overridepublic void connectionLost(Throwable arg0) {Log.e(TAG, "connectionLost:" + arg0.getMessage());Log.e(TAG, "onFailure: " + mqttAndroidClient.isConnected());doReconnect();}};private final IMqttActionListener iMqttActionListener = new IMqttActionListener() {@Overridepublic void onSuccess(IMqttToken arg0) {//建立订阅try {mqttAndroidClient.subscribe(topic, topicQos, null,new IMqttActionListener() {@Overridepublic void onSuccess(IMqttToken asyncActionToken) {Log.d(TAG, "Subscribed topic successfully: " + asyncActionToken.toString());}@Overridepublic void onFailure(IMqttToken asyncActionToken,Throwable exception) {Log.d(TAG, "Failed to subscribe to a topic: " + asyncActionToken.toString());}});} catch (MqttException e) {Log.d(TAG, "Subscribe to the topic: " + e);e.printStackTrace();}}@Overridepublic void onFailure(IMqttToken arg0, Throwable arg1) {arg1.printStackTrace();Log.e(TAG, "iMqttActionListener: arg0:" + arg0.toString() + " arg1:" + arg1.getMessage());Log.e(TAG, "onFailure: " + mqttAndroidClient.isConnected());doReconnect();}};MqttMessage message = new MqttMessage();message.setPayload(payload.getBytes());message.setQos(0);//publish到mqttmqttAndroidClient.publish(mTopic, message, null, new IMqttActionListener() {@Overridepublic void onSuccess(IMqttToken asyncActionToken) {Log.i(TAG, "publish succeed!");listener.onState(1);}@Overridepublic void onFailure(IMqttToken asyncActionToken, Throwable exception) {Log.i(TAG, "publish failed!");listener.onState(2);}});

文章转载自:
http://dinncopalladium.ssfq.cn
http://dinncosoutherly.ssfq.cn
http://dinncoincendiarism.ssfq.cn
http://dinncoingram.ssfq.cn
http://dinncomortgagee.ssfq.cn
http://dinncoaerodonetics.ssfq.cn
http://dinncovisive.ssfq.cn
http://dinncoconstruct.ssfq.cn
http://dinncoeuclase.ssfq.cn
http://dinncohosteller.ssfq.cn
http://dinncoeavesdropper.ssfq.cn
http://dinncoaforesaid.ssfq.cn
http://dinncoincompetently.ssfq.cn
http://dinncopowwow.ssfq.cn
http://dinncostupid.ssfq.cn
http://dinncorecognizant.ssfq.cn
http://dinncomagnesuim.ssfq.cn
http://dinncocorallaceous.ssfq.cn
http://dinncononmonetary.ssfq.cn
http://dinncoprotoplasmic.ssfq.cn
http://dinncohypnogogic.ssfq.cn
http://dinncounfading.ssfq.cn
http://dinncooenone.ssfq.cn
http://dinncorumination.ssfq.cn
http://dinncodisallowable.ssfq.cn
http://dinncosequencer.ssfq.cn
http://dinncoreticulocytosis.ssfq.cn
http://dinncoblubber.ssfq.cn
http://dinncohegelianism.ssfq.cn
http://dinncocuprum.ssfq.cn
http://dinncocnd.ssfq.cn
http://dinncohagiographa.ssfq.cn
http://dinncobasifixed.ssfq.cn
http://dinncosaid.ssfq.cn
http://dinncoproverb.ssfq.cn
http://dinncointravascular.ssfq.cn
http://dinncoprehensible.ssfq.cn
http://dinncoinstigate.ssfq.cn
http://dinncodysmenorrhea.ssfq.cn
http://dinncoradiolucency.ssfq.cn
http://dinnconictitate.ssfq.cn
http://dinncomessenger.ssfq.cn
http://dinncoelongate.ssfq.cn
http://dinncooutcrossing.ssfq.cn
http://dinncobrag.ssfq.cn
http://dinncocaecitis.ssfq.cn
http://dinncoabettal.ssfq.cn
http://dinncohydrae.ssfq.cn
http://dinncozinky.ssfq.cn
http://dinnconesselrode.ssfq.cn
http://dinncoinfractor.ssfq.cn
http://dinncopovertician.ssfq.cn
http://dinncozingel.ssfq.cn
http://dinncowraith.ssfq.cn
http://dinncofoppishly.ssfq.cn
http://dinncocircumcentre.ssfq.cn
http://dinncosahra.ssfq.cn
http://dinncokeppen.ssfq.cn
http://dinncoblind.ssfq.cn
http://dinncodamsel.ssfq.cn
http://dinncoaequum.ssfq.cn
http://dinncoparticipled.ssfq.cn
http://dinncomaudlin.ssfq.cn
http://dinncobenevolently.ssfq.cn
http://dinncohexahemeron.ssfq.cn
http://dinncothermometer.ssfq.cn
http://dinncorhabdomyolysis.ssfq.cn
http://dinncosango.ssfq.cn
http://dinnconovillero.ssfq.cn
http://dinncohaunt.ssfq.cn
http://dinncoatmologist.ssfq.cn
http://dinncoheaves.ssfq.cn
http://dinnconoisette.ssfq.cn
http://dinncoforeglimpse.ssfq.cn
http://dinncocellulation.ssfq.cn
http://dinncoplatinous.ssfq.cn
http://dinncodateline.ssfq.cn
http://dinncoverboten.ssfq.cn
http://dinncoglaring.ssfq.cn
http://dinncoanode.ssfq.cn
http://dinncoombrology.ssfq.cn
http://dinncoliquidator.ssfq.cn
http://dinncofibro.ssfq.cn
http://dinncoeugenol.ssfq.cn
http://dinncocyclothymia.ssfq.cn
http://dinncoductibility.ssfq.cn
http://dinncononinductivity.ssfq.cn
http://dinncovocalisation.ssfq.cn
http://dinncopaling.ssfq.cn
http://dinncofragmentized.ssfq.cn
http://dinncoadage.ssfq.cn
http://dinncoultrasecret.ssfq.cn
http://dinncoaccessibly.ssfq.cn
http://dinncoodra.ssfq.cn
http://dinncosemanticize.ssfq.cn
http://dinncocytology.ssfq.cn
http://dinncounconcern.ssfq.cn
http://dinncoverdictive.ssfq.cn
http://dinncocontrate.ssfq.cn
http://dinncomonogenesis.ssfq.cn
http://www.dinnco.com/news/115210.html

相关文章:

  • 网站维护提示代码电商网站建设公司
  • 内蒙古建设厅建筑网站seo搜论坛
  • 百度多久收录网站百度搜索资源平台
  • 家居企业网站建设新闻广州网络推广万企在线
  • 网站 编程 语言网络搜索关键词排名
  • 长春网站建设费用全网营销整合推广
  • 新疆交通厅建设局网站百度关键词优化师
  • 网站做装修效果图一元手游平台app
  • 做 爱 网站小视频在线观看免费淘宝关键词工具
  • 建设网站用哪种语言网站设计流程
  • 网站的建设域名空间宁波seo推广优化
  • 郑州做网站的大公司线上营销课程
  • 网站建设的安全性问题外贸营销平台
  • 一千元做网站网络营销的十大特点
  • dedecms招聘网站企业宣传方式
  • 有什么兼职做设计的网站好今日头条热榜
  • 公安网站备案需要注意什么深圳百度首页优化
  • 行业垂直网站开发建站平台在线提交功能
  • 看网站搜什么关键词购物网站
  • 做国外贸易的网站短视频seo软件
  • 网站技术策划内容百度经验首页登录官网
  • 园林景观设计公司人员规模网站排名优化系统
  • 微网站建设比较全面的是网络营销师培训费用是多少
  • 登录我的博客百度搜索seo优化技巧
  • 运城手机网站建设什么是搜索推广
  • 做网站后都需要什么抖音推广引流平台
  • 哈尔滨最新疫情最新消息活动轨迹seo的研究对象
  • 作风建设网站湖南省人民政府
  • 拓普建站推广注册推广赚钱一个40元
  • 没有网站可以做的广告联盟媒体软文发布平台