当前位置:网站首页>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
边栏推荐
- How to open a new bond? Is it safe to open an account
- Programmer: after 5 years in a company with comfortable environment, do you want to continue to cook frogs in warm water or change jobs?
- Do you really know "open source"? Please check [nanny level] open source Encyclopedia
- RTMP streaming platform easydss video on demand interface search bar development label fuzzy query process introduction
- [tke] GPU node NVIDIA Tesla driver reinstallation
- How does easygbs, a national standard platform, solve the problem that information cannot be carried across domains?
- How to configure the national standard platform easygbs neutral version?
- Reset the password, and the automatic login of the website saved by chrome Google browser is lost. What is the underlying reason?
- Installing sqlserver extension PDO of PHP under Linux_ sqlsrv
- 一纸英雄帖,激起千层浪,横跨10国,一线大厂都派人来了!-GWEI 2022-新加坡
猜你喜欢

Opencv learning notes - loading and saving images

MySQL 外键影响

Opencv learning notes -- Separation of color channels and multi-channel mixing

Installation and operation of libuv

Group planning - General Review

How can a shell script (.Sh file) not automatically close or flash back after execution?

Opencv learning notes - Discrete Fourier transform

一文讲透植物内生菌研究怎么做 | 微生物专题

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

mLife Forum | 微生物组和数据挖掘
随机推荐
从《梦华录》的争议性,谈谈数字版权作品的价值泡沫
Opencv learning notes - loading and saving images
9+! Predicting lymph node status from histology of colorectal cancer by deep learning
The pod is evicted due to insufficient disk space of tke node
Popular science of data annotation: ten common image annotation methods
How to configure the national standard platform easygbs neutral version?
pipeline groovy
Embedded must learn! Detailed explanation of hardware resource interface - based on arm am335x development board (Part 1)
[mysql_16] variables, process control and cursors
Difference between X12 830 and 862 messages
99% of the students can't write good code because of this problem!
深度学习~11+高分疾病相关miRNA研究新视角
Coinbase will launch the first encrypted derivative product for retail traders
[2021 techo youth dry goods sorting post, there is always one you are interested in]
[cloud based co creation] interpretation of harmonyos application and service ecology
Installation and operation of libuv
GTEST from getting started to getting started
JS和TS中常用特殊字符
I'm in Shenzhen. Where can I open an account? Is it safe to open an account online now?
Is it safe to apply for new bonds to open an account