当前位置:网站首页>105. simple chat room 8: use socket to transfer pictures
105. simple chat room 8: use socket to transfer pictures
2022-06-24 12:38:00 【Jasonakeke】
List of articles
Title Description
Topic realization : When using network programming , Need to pass through Socket Pass on the pictures .
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 :
By using DataInputStream Class read() Method , Read image file into byte array , And then use DataOutputStream Class from DataOutput Class inheritance write() Method to output an array of bytes , Thus, the use of Socket The function of transferring pictures .
Code details
边栏推荐
- [mysql_16] variables, process control and cursors
- [tke] GPU node NVIDIA Tesla driver reinstallation
- 深度学习~11+高分疾病相关miRNA研究新视角
- Programmer: after 5 years in a company with comfortable environment, do you want to continue to cook frogs in warm water or change jobs?
- 105. 简易聊天室8:使用 Socket 传递图片
- A good habit that makes your programming ability soar
- QT -- the qtabwidget supports dragging tabbar items
- 《回归故里》阅读笔记
- How to apply for new bonds is it safe to open an account
- 11+! Methylation modification patterns based on m6A regulatory factors in colon cancer are characterized by different tumor microenvironment immune spectra
猜你喜欢
mLife Forum | 微生物组和数据挖掘
【数据库】期末复习(计科版)
文本转语音功能上线,可以体验专业播音员的服务,诚邀试用
[mysql_16] variables, process control and cursors
How can a shell script (.Sh file) not automatically close or flash back after execution?
钉钉、飞书、企业微信:迥异的商业门道
Opencv learning notes - regions of interest (ROI) and image blending
Opencv learning notes - loading and saving images
【2022国赛模拟】摆(bigben)——行列式、杜教筛
使用开源工具 k8tz 优雅设置 Kubernetes Pod 时区
随机推荐
[mysql_16] variables, process control and cursors
解析nc格式文件,GRB格式文件的依赖包edu.ucar.netcdfAll的api 学习
《回归故里》阅读笔记
Use the object selection tool to quickly create a selection in Adobe Photoshop
巧妙构思-铁死亡调节因子分型预后发6+
Five minutes to develop your own code generator
Engage in audio and video development? Several things I have to say about SRT live broadcast protocol
[cloud based co creation] interpretation of harmonyos application and service ecology
What are the low threshold financial products in 2022? Not much money
Kubernetes practical technique: setting kernel parameters for pod
The solution of distributed system: directory, message queue, transaction system and others
Is it safe to apply for new bonds to open an account
Continuous testing | key to efficient testing in Devops Era
炒伦敦金短线稳定赚钱技巧?在哪里炒伦敦金安全靠谱?
Example of SMS interface verification code function implemented by ThinkPHP framework
Node cache vs browser cache
Google hacking search engine attack and Prevention
JS和TS中常用特殊字符
WPF从零到1教程详解,适合新手上路
How to calculate the bandwidth of video transmission? How much bandwidth is required to transmit 4K video?