当前位置:网站首页>彻底理解为什么网络 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

最后
参考资料

边栏推荐
猜你喜欢
2022 latest Android interview written examination, an Android programmer's interview experience
Various pits of vs2017 QT
Isprs2020/ cloud detection: transferring deep learning models for cloud detection between landsat-8 and proba-v
ConvMAE(2022-05)
The main thread anr exception is caused by too many binder development threads
Use of websocket tool
2022最新Android面试笔试,一个安卓程序员的面试心得
@Extension, @spi annotation principle
Take a look at semaphore, the current limiting tool provided by JUC
buuctf-pwn write-ups (9)
随机推荐
Pytorch yolov5 training custom data
sample_rate(采樣率),sample(采樣),duration(時長)是什麼關系
视频自监督学习综述
Einstein sum einsum
2022 Alibaba Android advanced interview questions sharing, 2022 Alibaba hand Taobao Android interview questions
[QNX hypervisor 2.2 user manual]6.3.2 configuring VM
C language makes it easy to add, delete, modify and check the linked list "suggested collection"
A2L file parsing based on CAN bus (3)
2022最新中高级Android面试题目,【原理+实战+视频+源码】
中文版Postman?功能真心强大!
RPC protocol details
vulnhub之darkhole_2
New words new words new words new words [2]
技术分享 | 接口测试价值与体系
U-Net: Convolutional Networks for Biomedical Images Segmentation
7-2 keep the linked list in order
AI open2022 | overview of recommendation systems based on heterogeneous information networks: concepts, methods, applications and resources
Trust counts the number of occurrences of words in the file
Oracle日期格式转换 to_date,to_char,to_timetamp 相互转换
The worse the AI performance, the higher the bonus? Doctor of New York University offered a reward for the task of making the big model perform poorly