在ajax请求期间,服务器和客户端之间的连接是否仍然打开? [英] during ajax request does the connection between the server and client remains open?

查看:89
本文介绍了在ajax请求期间,服务器和客户端之间的连接是否仍然打开?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在ajax请求期间,服务器和客户端之间的连接是否仍然打开?或者在对服务器进行ajax调用后关闭,然后在服务器将响应发送回客户端时重新打开。

解决方案

AJAX调用并不是什么新鲜事,但是一种以异步方式使用已知HTTP调用的方法...在HTTP世界中,服务器不知道调用之外的客户端,如果客户端关闭连接,则无法进行回调,换句话说,服务器无法打开与客户端的连接,因为它对客户端一无所知...

您可以看到答案是肯定的 - 连接保持打开状态,直到服务器发回结果...

During an ajax request does the connection between the server and client remains open? Or is it closed after making the ajax call to the server and then reopened when the server sends the response back to the client.

解决方案

AJAX call is nothing new, but a way of using known HTTP call in an asynchronous way...In the HTTP world the server knows nothing of the client outside the call and for that can not make callback if the client closes the connection, in other words the server can not open connection to the client as it does not know nothing about the client...
You can see that the answer is yes - the connection remains open until the server sends back the result...


这篇关于在ajax请求期间,服务器和客户端之间的连接是否仍然打开?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆