songxinjianqwe / Chat
Java NIO+多线程实现聊天室
Stars: ✭ 454
Programming Languages
java
68154 projects - #9 most used programming language
Labels
Projects that are alternatives of or similar to Chat
Spring Boot Websocket Chat Demo
Spring Boot WebSocket Chat Demo with SockJS fallback and STOMP protocol
Stars: ✭ 726 (+59.91%)
Mutual labels: spring, chat
Nettychat
基于Netty+TCP+Protobuf实现的Android IM库,包含Protobuf序列化、TCP拆包与粘包、长连接握手认证、心跳机制、断线重连机制、消息重发机制、读写超时机制、离线消息、线程池等功能。
Stars: ✭ 1,979 (+335.9%)
Mutual labels: nio, chat
Codeguide
📚 本代码库是作者小傅哥多年从事一线互联网 Java 开发的学习历程技术汇总,旨在为大家提供一个清晰详细的学习教程,侧重点更倾向编写Java核心内容。如果本仓库能为您提供帮助,请给予支持(关注、点赞、分享)!
Stars: ✭ 6,750 (+1386.78%)
Mutual labels: spring
Cookbook
🎉🎉🎉JAVA高级架构师技术栈==任何技能通过 “刻意练习” 都可以达到融会贯通的境界,就像烹饪一样,这里有一份JAVA开发技术手册,只需要增加自己练习的次数。🏃🏃🏃
Stars: ✭ 428 (-5.73%)
Mutual labels: nio
Thread Pool
Thread pool implementation using c++11 threads
Stars: ✭ 417 (-8.15%)
Mutual labels: thread-pool
Jeecg Boot
「企业级低代码平台」前后端分离架构SpringBoot 2.x,SpringCloud,Ant Design&Vue,Mybatis-plus,Shiro,JWT。强大的代码生成器让前后端代码一键生成,无需写任何代码! 引领新的开发模式OnlineCoding->代码生成->手工MERGE,帮助Java项目解决70%重复工作,让开发更关注业务,既能快速提高效率,帮助公司节省成本,同时又不失灵活性。
Stars: ✭ 26,432 (+5722.03%)
Mutual labels: spring
Joe
A general-purpose bot library inspired by Hubot but written in Go. 🤖
Stars: ✭ 417 (-8.15%)
Mutual labels: chat
Java Sourcecode Blogs
Java源码分析 【源码笔记】专注于Java后端系列框架的源码分析,每周持续推出Java后端系列框架的源码分析文章。
Stars: ✭ 448 (-1.32%)
Mutual labels: spring
React Chat Ui
🙊 A library of React components for building chat UI's.
Stars: ✭ 424 (-6.61%)
Mutual labels: chat
Framework Learning
计算机学习资料(Java , Jvm , Linux , Mysql , Netty , Redis , Netty , Spring , SpringBoot , Mybatis , Rabbitmq ,计算机网络 , 数据结构与算法 , 设计模式 )Github网页阅读:https://guang19.github.io/framework-learning , Gitee网页版阅读: https://qsjzwithguang19forever.gitee.io/framework-learning
Stars: ✭ 416 (-8.37%)
Mutual labels: spring
Java基于多线程和NIO实现聊天室
-
涉及到的技术点
- 线程池ThreadPoolExecutor
- 阻塞队列BlockingQueue,生产者消费者模式
- Selector
- Channel
- ByteBuffer
- ProtoStuff 高性能序列化
- HttpClient连接池
- Spring依赖注入
- lombok简化POJO开发
- 原子变量
- 内置锁
- CompletionService
- log4j+slf4j日志
-
实现的功能
- 登录注销
- 单聊
- 群聊
- 客户端提交任务,下载图片并显示
- 上线下线公告
- 在线用户记录
- 批量下载豆瓣电影的图片,并打为压缩包传输给客户端
-
客户端使用方式:
- 登录:默认用户名是user1-user5,密码分别是pwd1-pwd5
- 例:打开客户端后输入用户名为user1,密码为pwd1
- 注销:关闭客户端即可
- 单聊:@username:message
- 例:@user2:hello
- 群聊:message
- 例:hello,everyone
- 提交任务:task.file:图片的URL / task.crawl_image:豆瓣电影的id[?imageSize=n] 可以加请求参数
- 例1:task.file:https://img1.doubanio.com/view/movie_poster_cover/lpst/public/p2107289058.webp 下载完毕后会弹出一个框,输入想将其保存到的路径,比如E:/img.webp
- 例2:task.crawl_image:1292371?imageSize=2 下载完毕后在弹出的框中输入E:/images.zip
- 登录:默认用户名是user1-user5,密码分别是pwd1-pwd5
-
假设用户输入都是符合格式的
-
尽可能提高程序的健壮性,对各种异常情况进行处理
-
不得不承认的是,客户端做的很粗糙,主要开发目的还是练习Java的多线程和NIO
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].