当前位置:网站首页>108. simple chat room 11: realize client group chat
108. simple chat room 11: realize client group chat
2022-06-26 16:34:00 【Jasonakeke】
List of articles
Title Description
Topic realization : Different clients need to communicate , One client communicates with multiple other clients , Realize group chat function .
Implement one client to communicate with multiple other clients , Run the program , After the server starts , start-up 3 A client program , Then send information to the other two clients through the first client , Then the other two clients will receive the information sent by the server .
Their thinking
Create a service class :ClientOneToManyServerFrame, Inherit JFrame class
Define a createSocket() Method , Used to create a service Socket And listening to clients . And create and start the thread object and forward the received information sent by the client to other clients .
Create a client class :ClientOneToManyClientFrame, Inherit JFrame class
Define a createClientSocket() Method , Used to create a connection to the server Socket object , Output stream object , And the start thread object receives the information forwarded by the server .
Technical focus :
The server listens to the information sent by the client through the thread , When a client sends information , This information will be sent to other clients that have logged in to the server , But this message will not be sent to the sender , The client also listens to the information forwarded by the server through threads .
(1) Create a thread class on the server side S
边栏推荐
- Arduino uno + DS1302 simple time acquisition and serial port printing
- JS教程之 使用 Electron.JS 构建原生桌面应用程序乒乓游戏
- 【从删库到跑路】MySQL基础 完结篇(入个门先跑路了。。)
- Junit单元测试
- Kept to implement redis autofailover (redisha) 1
- 请指教同花顺软件究竟是什么?网上开户是否安全么?
- Solution for filtering by special string of microservice
- JS教程之使用 ElectronJS 桌面应用程序打印贴纸/标签
- 基于STM32+华为云IOT设计的云平台监控系统
- GUI+SQLServer考试系统
猜你喜欢

Dialogue with the senior management of Chang'an Mazda, new products will be released in Q4, and space and intelligence will lead the Japanese system

What does the inner structure of the neural network "alchemy furnace" look like? An interpretation of the thesis by the doctor of Oxford University

无需人工先验!港大&同济&LunarAI&旷视提出基于语义分组的自监督视觉表征学习,显著提升目标检测、实例分割和语义分割任务!...

100+ data science interview questions and answers Summary - basic knowledge and data analysis

"C language" question set of ⑩
![[Li Kou brush question] monotone stack: 84 The largest rectangle in the histogram](/img/75/440e515c82b5613b117728ba760786.png)
[Li Kou brush question] monotone stack: 84 The largest rectangle in the histogram

I regard it as a dry product with a monthly income of more than 30000 yuan for sidelines and more than 10000 yuan for novices!

Oilfield exploration problems

精致妆容成露营“软实力”,唯品会户外美妆护肤产品销量激增

C语言所有知识点小结
随机推荐
最小二乘系统辨识课 中篇:递归最小二乘
Solution for filtering by special string of microservice
Greenplum数据库故障分析——semop(id=2000421076,num=11) failed: invalid argument
Some instance methods of mono
Structure the graduation project of actual combat camp
【力扣刷题】二分查找:4. 寻找两个正序数组的中位数
Pybullet robot simulation environment construction 5 Robot pose visualization
C语言 头哥习题答案截图
# 补齐短板-开源IM项目OpenIM关于初始化/登录/好友接口文档介绍
内存分区模型
我把它当副业月入3万多,新手月入过万的干货分享!
Solidus Labs欢迎香港前金融创新主管赵嘉丽担任战略顾问
Redis migration (recommended operation process) 1
当一个程序员一天被打扰 10 次,后果很惊人!
STM32F103C8T6实现呼吸灯代码
清华“神奇药水”登Nature:逆转干细胞分化,比诺奖成果更进一步,网友:不靠精子卵子就能创造生命了?!...
理想路径问题
JS教程之Electron.js设计强大的多平台桌面应用程序的好工具
Vibrating liquid quantity detecting device
How to implement interface current limiting?