如何在不同计算机上用户之间的分享网站实时更新?机上、实时、不同、用户

2023-09-10 19:15:44 作者:小阿呆

我试图找出一种方法,一个网站的用户(比如学生和教师)来共享资源的位置在一个页面上实时更新由他们两人看到的安全连接。 从研究,我已经得出结论,一些实时的更新可以使用Ajax和JavaScript来执行。

I'm trying to figure out a way for users of a website (say a student and teacher) to share a secure connection where real time updates on one page are viewed by both of them. From research I've concluded that some of the real time updates could be performed using ajax and javascript.

但我难倒,以用户如何可以共享其中只有两个用户将查看该发生在网站上更新的连接(如绘图板的Flash动画。)我也困惑如何甚至将开始建立这样的连接。

But I'm stumped as to how users could share a connection where only the two users would be viewing the updates that take place on the website (such as flash animations of a drawing board.) I'm also confused how you would even begin to set up a connection like this.

我已经看了INTP PHP会议和饼干,但我不知道我在做正确的研究。 任何指针为两个特定用户如何分享,其中实时更新由只有他们两个人看的安全连接。我不想要一个简短的回应吧。我正在寻找类似的功能和语法具体到PHP的具体细节。我AP preciate的帮助,过会率您,如果你给了我很好的答案!

I've looked intp php sessions and cookies but I'm not sure I'm doing the right research. Any pointers as to how two specific users could share a secure connection where real time updates are viewed by the both of them only. I don't want a terse response please. I'm looking for specific details like functions and syntax specific to php. I appreciate the help and will rate you up if you give me good answers!

推荐答案

您不能共享一个安全连接(如HTTPS)的一个客户端一个服务器。

You cannot share a secure connection (e.g. HTTPS) its one client to one server.

如果两个客户端登录,并有一个背景AJAX的任务,在浏览器中运行,它是可以接受的每一个客户拉每隔几秒钟相同的数据,以显示这两个用户?

If both clients are logged in and have a background AJAX task running in the browser, is it acceptable to have each client "pull" every few seconds the same data to display for both users?

这将需要绘图板的更新也可以连续回发送到服务器,以与其他客户端共享更新后的数据。我敢肯定会有,你可以用它来触发数据的职位(如鼠标了)。

This would require the "drawing board" updates to also be sent continuously back to the server to share the updated data with the other client. I'm sure there will be an event you can use to trigger the post of data (e.g. on mouse up).

如果性能是一个问题,你会想用更好的服务器技术,如Java,能够保持请求之间的会话状态,而不必坚持到数据库中。

If performance is an issue, you'd want to use a better server technology like Java that is able to keep session state between requests without having to persist to a database.