current position:Home>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:40【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
copyright notice
author[Jasonakeke],Please bring the original link to reprint, thank you.
https://en.chowdera.com/2022/175/202206241031041660.html
The sidebar is recommended
- Pipeline shared library
- [2021 techo youth dry goods sorting post, there is always one you are interested in]
- pipeline groovy
- Pipeline post instruction
- Jenkins pipeline syntax
- How does the video networking / network penetration tool easynts permanently delete one of the devices?
- National standard platform easygbs administrator assigns roles to sub users and troubleshooting of invalid channels
- What is the reason why the video intelligent analysis platform easycvr is locally controllable but the superior equipment cannot control the subordinate equipment?
- RTMP streaming platform easydss video on demand interface search bar development label fuzzy query process introduction
- Conceptual analysis of DDD Domain Driven Design
guess what you like
Process of solving easydss virtual live video jam and instability problems by replacing push-pull stream Library
How to configure the national standard platform easygbs neutral version?
How to evaluate software development projects reasonably?
Smart photovoltaic energy - visualization of photovoltaic power generation energy management and control in the park
A "full cloud" journey of a quasi financial system
Automatic reconstruction of pod after modifying resource object
Tencent security monthly report - zero trust development trend forum, digital Expo Technology Award, Mercedes Benz security research results
Kubernetes log viewer - kubetail
[5 minutes to play lighthouse] create an immersive markdown writing environment
Tencent Youtu, together with Tencent security Tianyu and wechat, jointly launched an infringement protection scheme
Random recommended
- Hardware enterprise website ranking, 8 commonly used processes
- Fbnet/fbnetv2/fbnetv3: Facebook's lightweight network exploration in NAS | lightweight network
- A flaw in R markdown: folders cannot have Chinese
- Getting started with scrapy
- Detailed explanation of the execution order of the expression and loop body in the for loop
- Remote terminal RTU slope monitoring and early warning
- Jupyter notebook service installation and startup
- About Adobe Photoshop adjusting selection
- Kubernetes practical skills: use cert manager to issue free certificates for DNSPod domain names
- In depth analysis, from ordinary clock system to various time service modes
- What are the software prototyping tools?
- [tke] GPU node NVIDIA Tesla driver reinstallation
- A good habit that makes your programming ability soar
- Google hacking search engine attack and Prevention
- 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
- Installing sqlserver extension PDO of PHP under Linux_ sqlsrv
- Go basic series | 1 Leading
- Node cache vs browser cache
- Istio practical skills: implement header based authorization
- [Tencent cloud 618 countdown!] Promotion strategy of the promotion activities
- Simple and flexible permission design?
- Making daily menu applet with micro build low code
- 99% of the students can't write good code because of this problem!
- Istio practical skills: using prism to construct multi version test services
- Kubernetes practical technique: setting kernel parameters for pod
- A scheme for crawlers to collect public opinion data
- Essential key steps in the construction of e-commerce live broadcast source code
- How do websites and we media tap user needs? Deeply expose the secrets behind the keywords!
- From theory to practice, decipher Alibaba's internal MySQL optimization scheme in simple terms
- Continuous testing | key to efficient testing in Devops Era
- It's settled! Bank retail credit risk control just does it!
- Encapsulate the method of converting a picture file object to Base64
- The pod is evicted due to insufficient disk space of tke node
- Post processing - deep camera deformation effects
- Tencent released credit risk control results safely: it has helped banks lend more than 100 billion yuan
- Interesting erasure code
- Five minutes to develop your own code generator
- How to make secruecrt more productive
- About me, a 19 line programmer