当前位置:网站首页>103. simple chat room 6: using socket communication
103. simple chat room 6: using socket communication
2022-06-22 04:25:00 【Jasonakeke】
List of articles
Title Description
Topic realization : Socket is used to realize the communication between server and client .
Run the program , Enter information in the server-side text box , Then press enter , The client will receive the information sent by the server ;
Enter information in the client's text box , Then press enter , The server will receive the information sent by the client , Effect after sending information .
Their thinking
Create a server class :ServerSocketFrame, Inherit JFrame class
Write a getserver() Method , Instantiation Socket object , Enable 9527 When the port of the service .
Create an input stream object , Used to receive client information .
Let me define one more getClientInfo() Method , Used to receive information sent by the client .
Add an event to the text box : Realize sending weighing information to the client .
Create a client class :ClientSocketFrame, Inherit JFrame class .
Write a connect() Method , Instantiation Socket object , Connect to the local service 9527 Port services .
Let me define one more getClientInfo() Method , Used to receive information sent by the server .
Technical focus :
adopt Socket Class getInpuStream() Method to get the input stream object , With the help of InputStream
边栏推荐
- La première femme vient à 3A? Est - ce que Bright name, approuvé par IGN, peut mettre en évidence le classement
- FaceShifter. ipynb
- IDEA蓝屏的解决方案
- Topological sorting
- Popular science of source code encryption technology
- "Defi moral paradox" behind solend farce
- On the income of enterprise executives
- PCM数据格式
- Binary tree cueing
- 低功耗雷达感应模组,智能锁雷达感应方案应用,智能雷达传感器技术
猜你喜欢

About SSM integration, this is enough ~ (nanny level hands-on tutorial)

Laravel implements soft deletion

IDEA蓝屏的解决方案

"O & M youxiaodeng" active directory batch modification user

Active learning overview, strategy and uncertainty measurement

Relationship among original code, complement code and inverse code

How to use dataX to update the data in the downstream Oracle database with the update semantics

低功耗雷达感应模组,智能锁雷达感应方案应用,智能雷达传感器技术

图的BFS

Multithread interrupt usage
随机推荐
Some details
首个女性向3A手游要来了?获IGN认可,《以闪亮之名》能否突出重围
每日一问:ArrayList和LinkedList的区别
"Defi moral paradox" behind solend farce
Digital economy Wang Ning teaches you how to correctly choose short-term investment
Search (intensive training)
轻量级CNN设计技巧
Insert sort
[day 23] given an array of length N, return the array after deleting the x-th element | array deletion operation
Cordova 项目中自定义插件--插件创建流程
Idea installation and use tutorial
队列的顺序实现
TCL Huaxing released the world's first 0.016hz ultra-low frequency OLED wearable device screen
Odoo Development Manual (I) the second day of contact with odoo
EcRT of EtherCAT igh source code_ slave_ config_ Understanding of dc() function.
IDEA蓝屏的解决方案
[shell] method of adding 1 to 100
Sequential implementation of queues
Idea blue screen solution
低功耗雷达感应模组,智能锁雷达感应方案应用,智能雷达传感器技术