Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

第59题:请描述 HTTP 握手过程? #59

Open
noxussj opened this issue Jun 18, 2020 · 0 comments
Open

第59题:请描述 HTTP 握手过程? #59

noxussj opened this issue Jun 18, 2020 · 0 comments
Labels

Comments

@noxussj
Copy link
Owner

noxussj commented Jun 18, 2020

当建立协议的时候,TCP进行了3次握手

  1. 客户端请求连接服务器
  2. 服务器响应成功
  3. 客户端回应服务器准备开始连接

当终止协议的时候,tcp进行了4次挥手

  1. 客户端向服务器发送,断开请求
  2. 服务器向客户端发送,还有数据没有传输完毕,请稍等
  3. 服务器向客户端发送,传输完毕,可以随时断开请求了
  4. 客户端向服务器发送,你断开请求吧,不用回复了

然后各自断开请求

  1. 服务器断开请求
  2. 客户端等待2秒后没有收到消息,断开请求

也可以这么理解

男:我要挂了哦
女:等哈,我还要敷面膜
女:我敷完了,现在可以挂了
男:我舍不得挂,你挂吧

然后各自挂电话

女:好吧,我挂了
男:等了2MSL听见嘟嘟嘟的声音后挂断

image

参考资料
第 16 题:谈谈你对 TCP 三次握手和四次挥手的理解

@noxussj noxussj added the HTTP label Jun 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant