mqttserver:基于netty实现mqtt协议 服务器端开发-源码

上传者: 42117340 | 上传时间: 2021-07-24 19:23:36 | 文件大小: 115KB | 文件类型: ZIP
mqttserver,基于netty 4.1.1,可解码http、mqtt协议请求。 项目包括: 1.基于netty绑定端口监听,对于mqtt消息和http请求消息分别绑定不同的监听端口; 2.在MQTTServerInitializer中,分别添加mqtt编码解码器和http编码解码器,并分别将自定义的mqtt消息处理handle类和http消息handle类添加到信道中。添加心跳监听 3.在MQTTServerHandler中实现对mqtt消息的自定义处理。该handle类中处理包含内容: 对长链接通道建立clientid-channel内存缓存; 客户端接入时的在线状态处理; 对于不同类型的mqtt消息的分发处理; 连接断开时,客户端的离线状态处理; 心跳超时处理; 消息发布/订阅处理; 4.HttpServerHandler类实现对http消息的自定义处理。该handle类包含以下

文件下载

资源详情

[{"title":"( 80 个子文件 115KB ) mqttserver:基于netty实现mqtt协议 服务器端开发-源码","children":[{"title":"mqttserver-master","children":[{"title":"src","children":[{"title":"main","children":[{"title":"resources","children":[{"title":"system.properties <span style='color:#111;'> 605B </span>","children":null,"spread":false},{"title":"log4j2.xml <span style='color:#111;'> 2.77KB </span>","children":null,"spread":false}],"spread":true},{"title":"java","children":[{"title":"com","children":[{"title":"mqtt","children":[{"title":"jdbc","children":[{"title":"DBConnect.java <span style='color:#111;'> 5.54KB </span>","children":null,"spread":false},{"title":"UserDao.java <span style='color:#111;'> 4.71KB </span>","children":null,"spread":false}],"spread":true},{"title":"server","children":[{"title":"MQTTServerHandler.java <span style='color:#111;'> 16.45KB </span>","children":null,"spread":false},{"title":"HttpServerHandler.java <span style='color:#111;'> 12.49KB </span>","children":null,"spread":false},{"title":"MQTTServerInitializer.java <span style='color:#111;'> 3.22KB </span>","children":null,"spread":false},{"title":"MQTTServer.java <span style='color:#111;'> 3.12KB </span>","children":null,"spread":false},{"title":"sendMessage","children":[{"title":"SendOnlineMessageThread.java <span style='color:#111;'> 5.18KB </span>","children":null,"spread":false},{"title":"SendOfflineMessageThread.java <span style='color:#111;'> 3.55KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"exception","children":[{"title":"ApplicationException.java <span style='color:#111;'> 1.92KB </span>","children":null,"spread":false},{"title":"ParseMessageException.java <span style='color:#111;'> 650B </span>","children":null,"spread":false},{"title":"ErrorCode.java <span style='color:#111;'> 2.01KB </span>","children":null,"spread":false}],"spread":true},{"title":"util","children":[{"title":"DateUtil.java <span style='color:#111;'> 9.89KB </span>","children":null,"spread":false},{"title":"xmlhelper","children":[{"title":"DateAdapter.java <span style='color:#111;'> 915B </span>","children":null,"spread":false},{"title":"ObjectFactory.java <span style='color:#111;'> 333B </span>","children":null,"spread":false},{"title":"Helper.java <span style='color:#111;'> 4.71KB </span>","children":null,"spread":false}],"spread":true},{"title":"Constants.java <span style='color:#111;'> 4.89KB </span>","children":null,"spread":false},{"title":"json","children":[{"title":"gson","children":[{"title":"EmptyAdapterFactory.java <span style='color:#111;'> 1.29KB </span>","children":null,"spread":false},{"title":"GsonJsonUtil.java <span style='color:#111;'> 3.51KB </span>","children":null,"spread":false},{"title":"StringNullAdapter.java <span style='color:#111;'> 1.74KB </span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":"SysConfig.java <span style='color:#111;'> 3.40KB </span>","children":null,"spread":false}],"spread":true},{"title":"bean","children":[{"title":"forStb","children":[{"title":"StbReportMsg.java <span style='color:#111;'> 1.95KB </span>","children":null,"spread":false},{"title":"RequestMsg.java <span style='color:#111;'> 1.94KB </span>","children":null,"spread":false}],"spread":true},{"title":"forBusiness","children":[{"title":"UserInfo.java <span style='color:#111;'> 1.49KB </span>","children":null,"spread":false},{"title":"MsgToNode.java <span style='color:#111;'> 2.03KB </span>","children":null,"spread":false},{"title":"UpMessage.java <span style='color:#111;'> 2.00KB </span>","children":null,"spread":false},{"title":"MsgPublish.java <span style='color:#111;'> 3.82KB </span>","children":null,"spread":false},{"title":"MsgInfo.java <span style='color:#111;'> 3.76KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"task","children":[{"title":"PrintLocationStbInfoTask.java <span style='color:#111;'> 2.39KB </span>","children":null,"spread":false},{"title":"CleaOutOfTimeMsgTask.java <span style='color:#111;'> 1.95KB </span>","children":null,"spread":false},{"title":"ScheduleTask.java <span style='color:#111;'> 1.88KB </span>","children":null,"spread":false},{"title":"PrintBlankLogTask.java <span style='color:#111;'> 673B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":".classpath <span style='color:#111;'> 746B </span>","children":null,"spread":false},{"title":".settings","children":[{"title":"com.genuitec.eclipse.j2eedt.core.prefs <span style='color:#111;'> 87B </span>","children":null,"spread":false},{"title":"org.eclipse.m2e.core.prefs <span style='color:#111;'> 121B </span>","children":null,"spread":false},{"title":"org.eclipse.core.resources.prefs <span style='color:#111;'> 132B </span>","children":null,"spread":false},{"title":"org.eclipse.jdt.core.prefs <span style='color:#111;'> 695B </span>","children":null,"spread":false}],"spread":true},{"title":"pom.xml <span style='color:#111;'> 1.96KB </span>","children":null,"spread":false},{"title":"README.md <span style='color:#111;'> 1007B </span>","children":null,"spread":false},{"title":"target","children":[{"title":"classes","children":[{"title":"META-INF","children":[{"title":"MANIFEST.MF <span style='color:#111;'> 104B </span>","children":null,"spread":false},{"title":"maven","children":[{"title":"1","children":[{"title":"mqttServer_maven","children":[{"title":"pom.properties <span style='color:#111;'> 228B </span>","children":null,"spread":false},{"title":"pom.xml <span style='color:#111;'> 2.72KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"com","children":[{"title":"mqtt","children":[{"title":"jdbc","children":[{"title":"UserDao.class <span style='color:#111;'> 4.19KB </span>","children":null,"spread":false},{"title":"DBConnect.class <span style='color:#111;'> 5.00KB </span>","children":null,"spread":false}],"spread":true},{"title":"server","children":[{"title":"MQTTServer.class <span style='color:#111;'> 3.82KB </span>","children":null,"spread":false},{"title":"HttpServerHandler.class <span style='color:#111;'> 8.81KB </span>","children":null,"spread":false},{"title":"MQTTServerHandler.class <span style='color:#111;'> 15.93KB </span>","children":null,"spread":false},{"title":"MQTTServerInitializer.class <span style='color:#111;'> 2.80KB </span>","children":null,"spread":false},{"title":"sendMessage","children":[{"title":"SendOnlineMessageThread.class <span style='color:#111;'> 5.52KB </span>","children":null,"spread":false},{"title":"SendOfflineMessageThread.class <span style='color:#111;'> 4.15KB </span>","children":null,"spread":false}],"spread":false}],"spread":true},{"title":"exception","children":[{"title":"ParseMessageException.class <span style='color:#111;'> 825B </span>","children":null,"spread":false},{"title":"ErrorCode.class <span style='color:#111;'> 3.74KB </span>","children":null,"spread":false},{"title":"ApplicationException.class <span style='color:#111;'> 1.94KB </span>","children":null,"spread":false}],"spread":true},{"title":"util","children":[{"title":"DateUtil.class <span style='color:#111;'> 5.32KB </span>","children":null,"spread":false},{"title":"Constants.class <span style='color:#111;'> 3.43KB </span>","children":null,"spread":false},{"title":"xmlhelper","children":[{"title":"DateAdapter.class <span style='color:#111;'> 1.41KB </span>","children":null,"spread":false},{"title":"Helper.class <span style='color:#111;'> 5.31KB </span>","children":null,"spread":false},{"title":"ObjectFactory.class <span style='color:#111;'> 564B </span>","children":null,"spread":false}],"spread":false},{"title":"json","children":[{"title":"gson","children":[{"title":"EmptyAdapterFactory.class <span style='color:#111;'> 1.73KB </span>","children":null,"spread":false},{"title":"GsonJsonUtil.class <span style='color:#111;'> 2.80KB </span>","children":null,"spread":false},{"title":"StringNullAdapter.class <span style='color:#111;'> 2.08KB </span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":"SysConfig.class <span style='color:#111;'> 3.25KB </span>","children":null,"spread":false}],"spread":false},{"title":"bean","children":[{"title":"forStb","children":[{"title":"RequestMsg.class <span style='color:#111;'> 1.75KB </span>","children":null,"spread":false},{"title":"StbReportMsg.class <span style='color:#111;'> 1.84KB </span>","children":null,"spread":false}],"spread":false},{"title":"forBusiness","children":[{"title":"MsgInfo.class <span style='color:#111;'> 3.62KB </span>","children":null,"spread":false},{"title":"UpMessage.class <span style='color:#111;'> 1.97KB </span>","children":null,"spread":false},{"title":"MsgPublish.class <span style='color:#111;'> 3.48KB </span>","children":null,"spread":false},{"title":"MsgToNode.class <span style='color:#111;'> 2.17KB </span>","children":null,"spread":false},{"title":"UserInfo.class <span style='color:#111;'> 1.56KB </span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":"task","children":[{"title":"ScheduleTask.class <span style='color:#111;'> 2.58KB </span>","children":null,"spread":false},{"title":"PrintLocationStbInfoTask.class <span style='color:#111;'> 3.19KB </span>","children":null,"spread":false},{"title":"CleaOutOfTimeMsgTask.class <span style='color:#111;'> 2.77KB </span>","children":null,"spread":false},{"title":"PrintBlankLogTask.class <span style='color:#111;'> 890B </span>","children":null,"spread":false}],"spread":false}],"spread":true}],"spread":true},{"title":"system.properties <span style='color:#111;'> 605B </span>","children":null,"spread":false},{"title":"log4j2.xml <span style='color:#111;'> 2.77KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":".project <span style='color:#111;'> 568B </span>","children":null,"spread":false},{"title":"logs","children":[{"title":"reportMsg","children":[{"title":"reportMsg.log <span style='color:#111;'> 2B </span>","children":null,"spread":false}],"spread":true},{"title":"mqtt_debug.log <span style='color:#111;'> 1.15KB </span>","children":null,"spread":false},{"title":"mqtt_error.log <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明