当前位置:网站首页>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
边栏推荐
- ES无法工作,CircuitBreakingException
- IDS interview questions collection data structure + penetration avalanche + persistence + memory elimination strategy + database double write + Sentinel
- Bubble sort
- 轻量级CNN设计技巧
- fc2新域名有什么价值?如何解析到网站?
- Case driven: a detailed guide from getting started to mastering shell programming
- System V IPC and POSIX IPC
- Storage structure of tree
- Calculation of audio frame size
- Raspberry pie preliminary use
猜你喜欢

Online text batch inversion by line tool

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

Fonctionnement de base du tableau de séquence

It is about one-step creating Yum source cache in Linux

Sequential implementation of queues

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

Idea blue screen solution

拓扑排序

"Defi moral paradox" behind solend farce

IDS interview questions collection data structure + penetration avalanche + persistence + memory elimination strategy + database double write + Sentinel
随机推荐
ln n, n^k , a^n, n!, n^n的极限问题
什么是论坛虚拟主机?如何挑选?
Adjacency matrix, adjacency table, cross linked list, adjacency multi table
Yum command
Popular science of source code encryption technology
System V IPC and POSIX IPC
[shell] method of adding 1 to 100
SSM inpatient management system
Shell Sort
PHP connection to mysql8.0 reports an error: illuminate\database\queryexception
SQL operation: with expression and its application
IDEA蓝屏的解决方案
Digital economy Wang Ning teaches you how to correctly choose short-term investment
源代码加密技术科普
Cloud function realizes fuzzy search function
How do redis and MySQL maintain data consistency? Strong consistency, weak consistency, final consistency
邻接矩阵,邻接表,十字链表,邻接多重表
torch DDP Training
DFS of graph
It is about one-step creating Yum source cache in Linux