当前位置:网站首页>彻底理解为什么网络 I/O 会被阻塞?
彻底理解为什么网络 I/O 会被阻塞?
2022-07-05 18:34:00 【InfoQ】
I/O到底是什么?
创建 socket
- domain:这个参数用于选择通信的协议族,比如选择 IPv4 通信,还是 IPv6 通信等等
- type:选择套接字类型,可选字节流套接字、数据报套接字等等。
- protocol:指定使用的协议。
bind
listen
- socket 有一个队列,同时存放已完成的连接和半连接,backlog为这个队列的大小。
- socket 有两个队列,分别为已完成的连接队列和半连接队列,backlog为这个两个队列的大小之和。
- socket 有两个队列,分别为已完成的连接队列和半连接队列,backlog仅为已完成的连接队列大小。

【文章福利】另外小编还整理了一些C++后端开发面试题,教学视频,后端学习路线图免费分享,需要的可以自行添加:
学习交流群点击加入~
群文件共享
小编强力推荐C++后端开发免费学习地址:
C/C++Linux服务器开发高级架构师/C++后台开发架构师

accept

connect


- connect:需要阻塞等待三次握手的完成。
- accept:需要等待可用的已完成的连接,如果已完成连接队列为空,则被阻塞。
read、write

最后
参考资料

边栏推荐
- Take a look at semaphore, the current limiting tool provided by JUC
- 让更多港澳青年了解南沙特色文创产品!“南沙麒麟”正式亮相
- Logical words in Articles
- 集合处理的利器
- LeetCode 6109. Number of people who know the secret
- Thoroughly understand why network i/o is blocked?
- LeetCode 6111. Spiral matrix IV
- 图扑软件数字孪生智慧风电系统
- Powerful tool for collection processing
- ICML2022 | 长尾识别中分布外检测的部分和非对称对比学习
猜你喜欢

buuctf-pwn write-ups (9)

The 11th China cloud computing standards and Applications Conference | China cloud data has become the deputy leader unit of the cloud migration special group of the cloud computing standards working

Introduction to the development function of Hanlin Youshang system of Hansheng Youpin app

2022年阿里Android高级面试题分享,2022阿里手淘Android面试题目

Take a look at semaphore, the current limiting tool provided by JUC

瞅一瞅JUC提供的限流工具Semaphore

技术分享 | 接口测试价值与体系

2022 latest Android interview written examination, an Android programmer's interview experience

Isprs2022/ cloud detection: cloud detection with boundary nets

How to write good code defensive programming
随机推荐
Idea configuring NPM startup
紧固件行业供应商绩效考核繁琐?选对工具才能轻松逆袭!
Clickhouse (03) how to install and deploy Clickhouse
How to obtain the coordinates of the aircraft passing through both ends of the radar
Is it safe to open an account and register stocks for stock speculation? Is there any risk? Is it reliable?
快速生成ipa包
jdbc读大量数据导致内存溢出
Quickly generate IPA package
The main thread anr exception is caused by too many binder development threads
vulnhub之darkhole_2
The 10th global Cloud Computing Conference | Huayun data won the "special contribution award for the 10th anniversary of 2013-2022"
Overview of video self supervised learning
Linear table - abstract data type
SAP 特征 特性 说明
基于can总线的A2L文件解析(3)
《ClickHouse原理解析与应用实践》读书笔记(5)
【Autosar 十四 启动流程详解】
lombok @Builder注解
Powerful tool for collection processing
RPC协议详解