• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

会话,HTTP连接:间的区别?

用户头像
it1352
帮助1

问题说明

我一直在阅读.看完书后,我发现自己现在对我的基础知识非常困惑.请帮助我,因为它涉及到网络和JSP的基础知识. Servlets

I have been reading this and this. After reading I found myself very confused with my basics now. Please help me out as it involves the basics of networking and JSPs & Servlets

考虑这种假设情况:

如果我在某些浏览器上打开了www.xyz.com,但当天却没有在该页面上执行任何操作.

If I open some www.xyz.com on some browser and don't do anything on that page for day.

Q.1如果第二天我从该页面请求某些内容,那意味着相同的连接仍然存在.考虑连接:保持活动在那里.

Q.1 Would that mean that same connection still exists if next day I request something from that page. Considering Connection: keep-alive is there.

Q.2会话在这种情况下如何工作-我发现,如果会话过期,连接也将过期,那么HTTP连接和会话之间有什么区别?就像当我们在同一浏览器中打开Facebook的多个标签时会发生什么情况(这是同一会话,但连接不同?我正确吗?)

Q.2 How does session works in this context -I have found that if session gets expired so will connection, so what is the difference between HTTP Connection and Session ? Like what happens when we open multiple tab of Facebook in same browser (It is same session but different connection ? Am I correct ?)

HTTP 1.1标准的一项重大改进是持久连接.在HTTP 1.0中,在单个请求/响应周期之后,将关闭Web客户端与服务器之间的连接.在HTTP 1.1中,连接保持活动状态,并可以重复用于多个请求.持久连接可以明显减少通信延迟,因为客户端不需要在每次请求后重新协商TCP连接.

A major improvement in the HTTP 1.1 standard is persistent connections. In HTTP 1.0, a connection between a Web client and server is closed after a single request/response cycle. In HTTP 1.1, a connection is kept alive and reused for multiple requests. Persistent connections reduce communication lag perceptibly, because the client doesn't need to renegotiate the TCP connection after each request.

浏览器如何保持持久连接?

How does browser maintain a persistent connection ?

注意:如果有人可以以此方式回答这个问题,那会更好. >

NOTE : It would be better if someone could answer this question this way

正确答案

#1

要回答您的问题:

A1:否,第二天不存在联系. 保持活动状态"(在HTTP中)的值通常很低,无法整日保持正常运行.

A1: No, next day connection won't be there. Keep-Alive (in HTTP) values are usually low enough to not make it through the day.

A2:会话在服务器端维护.它与通信的保持活动"无关.它的有效期有一个单独的值(取决于您的配置方式).您是正确的:不同的选项卡,相同的会话,不同的连接.通常,使用通用Cookie将会话粘合在一起.因此,当您清洁Cookie时,通常会松开所有会话.

A2: Session is maintained server side. It has nothing to do with communication's Keep-Alive. It has a separate value for its expiry time (depends on how you configure it). You are correct: different tabs, same session, different connections. Usually sessions are glued together using common cookies. That's why when you clean your cookies, you usually loose all your sessions.

A3:浏览器根本不会关闭TCP/IP连接.就是这样.

A3: Browser simply does not close the TCP/IP connection. That's how it does it.

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /reply/detail/tanhcgaeif
系列文章
更多 icon
同类精品
更多 icon
继续加载