当前位置:网站首页>Network communication basic kit -- IPv4 socket structure
Network communication basic kit -- IPv4 socket structure
2022-07-04 02:10:00 【Soy sauce;】
1. Network communication solves three problems

2.ipv4 Socket structure
strcut sockaddr Many network programming functions were born before IPv4 agreement , At that time, they all used sockaddr Structure , For forward compatibility , Now? sockaddr Degenerated into (void *) The role of , Pass an address to the function , As for this function is sockaddr_in still sockaddr_in6, Determined by the address family , Then the internal function forces the type to be converted to the required address type .

General socket structure
struct sockaddr {
sa_family_t sa_family; /* address family, AF_xxx */
char sa_data[14]; /* 14 bytes of protocol address */
};
边栏推荐
- Customize redistemplate tool class
- mysql使用視圖報錯,EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
- Small program graduation project based on wechat e-book small program graduation project opening report function reference
- Three layer switching ①
- Sword finger offer 20 String representing numeric value
- Write the first CUDA program
- Servlet simple verification code generation
- 12. Gettimeofday() and time()
- The difference between int (1) and int (10)
- 2022 new examination questions for safety management personnel of hazardous chemical business units and certificate examination for safety management personnel of hazardous chemical business units
猜你喜欢

16. System and process information

在尋求人類智能AI的過程中,Meta將賭注押向了自監督學習

Solution to the problem that jsp language cannot be recognized in idea

MPLS③

Mysql-15 aggregate function

Conditional statements of shell programming

Libcblas appears when installing opencv import CV2 so. 3:cannot open shared object file:NO such file or directory

Advanced learning of MySQL -- Application -- storage engine
![The contact data on Jerry's management device supports reading and updating operations [articles]](/img/89/d36e785bd94c2373c34fb95eee3a9c.jpg)
The contact data on Jerry's management device supports reading and updating operations [articles]

Huawei cloud micro certification Huawei cloud computing service practice has been stable
随机推荐
What is the student party's Bluetooth headset recommendation? Student party easy to use Bluetooth headset recommended
16. System and process information
MySQL utilise la vue pour signaler les erreurs, Explicit / show ne peut pas être publié; Verrouillage des fichiers privés pour la table sous - jacente
Servlet simple verification code generation
[Yugong series] February 2022 attack and defense world advanced question misc-83 (QR easy)
Bacteriostatic circle scanning correction template
Jerry's watch listens to the message notification of the target third-party software and pushes the message to the device [article]
When tidb meets Flink: tidb efficiently enters the lake "new play" | tilaker team interview
Containerization technology stack
Mobile phone battery - current market situation and future development trend
在尋求人類智能AI的過程中,Meta將賭注押向了自監督學習
Jerry's synchronous weather information to equipment [chapter]
The contact data on Jerry's management device supports reading and updating operations [articles]
Mysql-15 aggregate function
Introduction to Tianchi news recommendation: 4 Characteristic Engineering
High level application of SQL statements in MySQL database (I)
Create real-time video chat in unity3d
What is the intelligent monitoring system of sewage lifting pump station and does it play a big role
A. ABC
Magical usage of edge browser (highly recommended by program ape and student party)