当前位置:网站首页>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
边栏推荐
- Remote terminal RTU slope monitoring and early warning
- Data stack technology sharing: open source · data stack - extend flinksql to realize the join of flow and dimension tables
- Pinduoduo press the user accelerator key
- 巧妙构思-铁死亡调节因子分型预后发6+
- Installing sqlserver extension PDO of PHP under Linux_ sqlsrv
- Chenglixin research group of Shenzhen People's hospital proposed a new method of multi group data in the diagnosis and prognosis analysis of hepatocellular carcinoma megps
- How to check the situation that the national standard platform easygbs equipment video cannot be accessed by grabbing packets?
- Conceptual analysis of DDD Domain Driven Design
- Identification of new prognostic DNA methylation features in uveal melanoma by 11+ based on methylation group and transcriptome analysis~
- Use txvideoeditor to add watermark and export video card at 99%? No successful failed callback?
猜你喜欢
Cloud native database: the outlet of the database, you can also take off

MySQL 外键影响

巴比特 | 元宇宙每日必读:618成绩已然揭晓,在这份还算满意的答卷背后,数字藏品做出了多少贡献?...

QT -- the qtabwidget supports dragging tabbar items

解析nc格式文件,GRB格式文件的依赖包edu.ucar.netcdfAll的api 学习

Ten thousand campus developers play AI in a fancy way. It's enough to see this picture!

Group planning - General Review

GTEST from getting started to getting started

【数据库】期末复习(计科版)

从《梦华录》的争议性,谈谈数字版权作品的价值泡沫
随机推荐
9+! Predicting lymph node status from histology of colorectal cancer by deep learning
Tencent cloud and the ICT Institute launched the preparation of the "cloud native open source white paper" to deeply interpret cloud native
Group planning - General Review
About me, a 19 line programmer
Opencv learning notes -- Separation of color channels and multi-channel mixing
Single gene pan cancer + simple experiment can be published 7 points+
Essential key steps in the construction of e-commerce live broadcast source code
Cluster control management
A flaw in R markdown: folders cannot have Chinese
Tencent released credit risk control results safely: it has helped banks lend more than 100 billion yuan
Difference between X12 830 and 862 messages
MySQL 外键影响
短信服务sms
一纸英雄帖,激起千层浪,横跨10国,一线大厂都派人来了!-GWEI 2022-新加坡
Embedded must learn! Detailed explanation of hardware resource interface - based on arm am335x development board (Part 2)
Opencv learning notes - regions of interest (ROI) and image blending
How does the video networking / network penetration tool easynts permanently delete one of the devices?
Deep parsing and implementation of redis pub/sub publish subscribe mode message queue
Interesting erasure code
使用开源工具 k8tz 优雅设置 Kubernetes Pod 时区