Comments (1)
This was the first project I studied, probably because of my limited ability, and I found that some places were not well understood. The following three points are some of my questions. Thank you for your guidance.
(1) Why isn't
pid < 3
here? Is there any special meaning forpid
being2
?
Lines 411 to 416 in b1acf3c
(2) Why does the
bench()
functionreturn i
? Isn't this thespeed
value that the parent process successfully read the last time? Could I change the program toreturn 0
?
Line 435 in b1acf3c
(3) Add
close(sock);
is it more rigorous?
Lines 54 to 55 in b1acf3c
My personal opinion:
(1): Because in common Linux operating systems, the PID of 0 and 1 have been occupied by the process operating system and the software which cooperates with the operating system.
(2): Currently, I'm facing the same problem with you, and I think you are true.
(3): Use man 3 connect
, and I have found this sentenceAPPLICATION USAGE: If connect() fails, the state of the socket is unspecified. Conforming applications should close the file descriptor and create a new socket before attempting to reconnect. So I agree with you.
from webbench.
Related Issues (13)
- 编译过程中的一个小错误 HOT 1
- variable usage HOT 1
- 解决OSX max user processes 问题
- [archlinux] fatal error: rpc/types.h: No such file or directory
- 为什么程序中要加一个值是否为1的判断 HOT 2
- centos8 编译报错 HOT 2
- ubuntu 18 和20可以吗?
- 实现原理 HOT 1
- debug的时候不能进入benchcore这个方法里面
- mac 下安装报错 HOT 2
- 为什么一定要保证`proxyhost!=NULL` HOT 2
- 关于http request的请求方法 HOT 1
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 webbench.