Nio的方式实现Websocket通讯(解决websocket手机端经常连接不上)

上传者: hejin17909mm | 上传时间: 2022-04-13 10:52:44 | 文件大小: 1024KB | 文件类型: RAR
这个Demo是通过NioSession实现的,Tomcat自带的websockt使用手机端连接会经常链接不上,这个Demo非常有效解决了手机端连接不上websocket的bug。demo是SE项目,执行main启动服务器后,web端通过ws的方式连接即可,端口在代码里面有,自己下代码琢磨下就行,通俗易懂!

文件下载

资源详情

[{"title":"( 29 个子文件 1024KB ) Nio的方式实现Websocket通讯(解决websocket手机端经常连接不上)","children":[{"title":"WebServer","children":[{"title":"bin","children":[{"title":"mina","children":[{"title":"MinaServer.class <span style='color:#111;'> 2.15KB </span>","children":null,"spread":false},{"title":"MinaServerHandler.class <span style='color:#111;'> 3.25KB </span>","children":null,"spread":false},{"title":"MinaDecoder$BaseSocketBeanDecoder.class <span style='color:#111;'> 2.70KB </span>","children":null,"spread":false},{"title":"MinaEncoder.class <span style='color:#111;'> 588B </span>","children":null,"spread":false},{"title":"MinaBean.class <span style='color:#111;'> 971B </span>","children":null,"spread":false},{"title":"MinaDecoder.class <span style='color:#111;'> 714B </span>","children":null,"spread":false},{"title":"MinaEncoder$BaseSocketBeanEncoder.class <span style='color:#111;'> 1.93KB </span>","children":null,"spread":false}],"spread":true},{"title":"view","children":[{"title":"IUpdateViewFactory.class <span style='color:#111;'> 532B </span>","children":null,"spread":false},{"title":"UpdateView.class <span style='color:#111;'> 178B </span>","children":null,"spread":false},{"title":"MainView.class <span style='color:#111;'> 2.60KB </span>","children":null,"spread":false}],"spread":true},{"title":"log4j.properties <span style='color:#111;'> 1.48KB </span>","children":null,"spread":false},{"title":"utils","children":[{"title":"WebSocketUtil.class <span style='color:#111;'> 2.60KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":".settings","children":[{"title":"org.eclipse.jdt.core.prefs <span style='color:#111;'> 598B </span>","children":null,"spread":false}],"spread":true},{"title":"src","children":[{"title":"mina","children":[{"title":"MinaEncoder.java <span style='color:#111;'> 1.02KB </span>","children":null,"spread":false},{"title":"MinaServerHandler.java <span style='color:#111;'> 2.57KB </span>","children":null,"spread":false},{"title":"MinaDecoder.java <span style='color:#111;'> 4.50KB </span>","children":null,"spread":false},{"title":"MinaServer.java <span style='color:#111;'> 1.55KB </span>","children":null,"spread":false},{"title":"MinaBean.java <span style='color:#111;'> 490B </span>","children":null,"spread":false}],"spread":true},{"title":"view","children":[{"title":"IUpdateViewFactory.java <span style='color:#111;'> 281B </span>","children":null,"spread":false},{"title":"MainView.java <span style='color:#111;'> 1.81KB </span>","children":null,"spread":false},{"title":"UpdateView.java <span style='color:#111;'> 112B </span>","children":null,"spread":false}],"spread":true},{"title":"log4j.properties <span style='color:#111;'> 1.48KB </span>","children":null,"spread":false},{"title":"utils","children":[{"title":"WebSocketUtil.java <span style='color:#111;'> 2.51KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":".project <span style='color:#111;'> 385B </span>","children":null,"spread":false},{"title":".classpath <span style='color:#111;'> 552B </span>","children":null,"spread":false},{"title":"lib","children":[{"title":"slf4j-log4j12-1.7.6.jar <span style='color:#111;'> 8.66KB </span>","children":null,"spread":false},{"title":"mina-core-2.0.9.jar <span style='color:#111;'> 617.94KB </span>","children":null,"spread":false},{"title":"log4j-1.2.17.jar <span style='color:#111;'> 478.40KB </span>","children":null,"spread":false},{"title":"slf4j-api-1.7.12.jar <span style='color:#111;'> 31.37KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}]

评论信息

  • weixin_42101827 :
    重新下载试一下看看能不能跑
    2019-06-04

免责申明

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