当前位置:网站首页>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
边栏推荐
- 解决Swagger2显示UI界面但是没内容
- Case driven: a detailed guide from getting started to mastering shell programming
- Read stream special attention
- Storage structure of tree
- DFS of graph
- Is the Guoyuan futures account reliable? How can a novice safely open an account?
- 拓扑排序
- SSM based blog system [with background management]
- 插入排序
- Qt项目的新首席维护人员
猜你喜欢

TCL Huaxing released the world's first 0.016hz ultra-low frequency OLED wearable device screen

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

【写文章神器】标记语言Markdown的使用

什么是论坛虚拟主机?如何挑选?

Basic operation of sequence table

Low power radar sensing module, application of smart lock radar sensing scheme, smart radar sensor technology

Case driven: a detailed guide from getting started to mastering shell programming

Use putty to configure port mapping to realize the access of the external network to the server

Windows10 cannot access LAN shared folder

套用这套模板,玩转周报、月报、年报更省事
随机推荐
SQL operation: with expression and its application
[shell] method of adding 1 to 100
Interaction between C language and Lua (practice 3)
Pytorch之contiguous函数
Fastadmin list multi image preview (zoom in preview, rotation) one line of code
About calling EditText in dialog
快速排序
解决Swagger2显示UI界面但是没内容
插入排序
FaceShifter. ipynb
Sequential implementation of queues
Basic concept of graph
Existing requirements synchronize other database user information to our system. Their primary key ID is string and our primary key is long
图的DFS
Idea installation and use tutorial
Go learning notes
What is the value of the FC2 new domain name? How to resolve to a website?
When the move protocol beta is in progress, the ecological core equity Momo is divided
BFs of figure
通过ip如何免费反查域名?