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

tcp和http之间的关系 #11

Open
yuandaishi opened this issue Apr 9, 2019 · 0 comments
Open

tcp和http之间的关系 #11

yuandaishi opened this issue Apr 9, 2019 · 0 comments
Labels
http Something isn't working

Comments

@yuandaishi
Copy link
Owner

1.tcp属于传输层,http属于应用层。
2.http是在tcp协议基础上的一种应用。
3.tcp链接需要经过3次握手(请求,确认,连接)和4次挥手,在连接建立的过程中,请求不包含数据包。
4.tcp连接建立之后,除非服务器或者客户端某一方主动断开连接,要不然连接就回持续下去。
5.http是无状态的短连接,即每次发起请求后,服务器有响应之后,tcp连接就回断开,下次发起请求,又要重新建立tcp连接。而且服务器只能在有请求的时候,才能发出响应,不能主动的发出响应。
参考:

  1. 通俗大白话来理解TCP协议的三次握手和四次分手
  2. TCP和Http的区别!我都搞懂了,你就别迷糊了!
@yuandaishi yuandaishi added the http Something isn't working label Apr 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
http Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant