当前位置:网站首页>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
边栏推荐
- Tencent Youtu, together with Tencent security Tianyu and wechat, jointly launched an infringement protection scheme
- Single gene pan cancer + simple experiment can be published 7 points+
- Use txvideoeditor to add watermark and export video card at 99%? No successful failed callback?
- Clickhouse uses distributed join of pose series
- A flaw in R markdown: folders cannot have Chinese
- From theory to practice, decipher Alibaba's internal MySQL optimization scheme in simple terms
- Continuous testing | making testing more free: practicing automated execution of use cases in coding
- Is it safe to apply for new bonds to open an account
- GTEST from getting started to getting started
- Opencv learning notes - cv:: mat class
猜你喜欢
Opencv learning notes - loading and saving images
Ten thousand campus developers play AI in a fancy way. It's enough to see this picture!
mLife Forum | 微生物组和数据挖掘
Opencv learning notes - regions of interest (ROI) and image blending
WPF从零到1教程详解,适合新手上路
Opencv learning notes -- Separation of color channels and multi-channel mixing
文本转语音功能上线,可以体验专业播音员的服务,诚邀试用
GTEST from getting started to getting started
[mysql_16] variables, process control and cursors
【数据库】期末复习(计科版)
随机推荐
Ingenious conception - iron death regulatory factor classification and prognosis 6+
How to solve the problem that MBR does not support partitions over 2T, and lossless transfer to GPT
Collation of related papers on root cause analysis
[cloud based co creation] interpretation of harmonyos application and service ecology
Cryptography series: collision defense and collision attack
The pod is evicted due to insufficient disk space of tke node
The latest hot spot: the use of copper death related genes for tumor prognosis typing!
Kubernetes log viewer - kubetail
Design and implementation of high performance go log library zap
MySQL 外键影响
解析nc格式文件,GRB格式文件的依赖包edu.ucar.netcdfAll的api 学习
Is it safe to open an account under the conditions of new bonds
How to check the situation that the national standard platform easygbs equipment video cannot be accessed by grabbing packets?
广发证券靠谱吗?开证券账户安全吗?
Adjustment method of easynvr video platform equipment channel page display error
Cloud native database: the outlet of the database, you can also take off
What are the low threshold financial products in 2022? Not much money
打新债的条件 开户是安全的吗
Opencv learning notes -- Separation of color channels and multi-channel mixing
Detailed explanation of the execution order of the expression and loop body in the for loop