Comments (1)
shutdown可以指定在某个方向上终止连接,通过指定标志:SHUT_RD, SHUT_WR, SHUT_RDWR。比如指定SHUT_WR后可以继续读数据,但不能写入了。而close是两个方向上终止连接。
close会将描述符的引用计数减一,如果引用计数变为0就关闭描述符,发送FIN。而shutdown不管引用计数,直接发送FIN终止连接。所以在多线程下操作同一个socket描述符下,一个线程调用shutdown会使其他线程无法使用这个描述符,而调用close就不会影响到其他线程。
from uv-cpp.
Related Issues (20)
- 新版的代码中有未定义的 ssize_t
- 编译出错 HOT 2
- TimerWheel 类的是否会将没有超时连接删除 HOT 8
- 请问是否支持ssl? HOT 1
- 关于内存的释放问题 HOT 5
- httpserver长链接
- uv-cpp做客户端时,当服务端连不上,重复去连接时,无论是linux还是Windows都会奔溃 HOT 14
- libuv升级到新版本支持吗 HOT 1
- client跨线程循环发送时候 ,client崩溃 HOT 4
- linux centos7下,偶现程序运行一段时间后,CPU使用率100%的情况。最后奔溃。 HOT 1
- centos 7 运行一晚第二天看到崩溃了 HOT 2
- 请教下 这个可以支持百万或者千万并发吗? HOT 3
- 你好,cmake和make之后该怎么运行helloworld例子 HOT 3
- async 有对应的例子吗?
- http中增加一个 http 添加 静态文件目录 ? HOT 1
- 有没有多线程或者线程池的例子,如何开16个线程 HOT 5
- Question:为什么只有TcpServer端才有setTimeout接口,客户端没有相应的setTimeout接口? HOT 2
- 高概率出现signal信号没有被捕获到的问题
- 因为事件循环loop->run会阻塞当前线程,所以通常的做法是阻塞主线程,还是启动子线程然后让事件循环阻塞在子线程中? HOT 2
- 程序高概率会发生段错误,下面是core文件,请帮忙分析下是什么原因?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uv-cpp.