XMPP for PHP(怎么做) [英] XMPP for PHP (how to do it)

查看:51
本文介绍了XMPP for PHP(怎么做)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先我将概述我的问题.

我想做的是创建一个站点.当一个客户端连接时,他每隔一秒左右就会广播一个号码.

What I want to do is create a site. When a client connects, every second or so a number will be broadcast by him.

这是由网站上的每个人完成的.

This is done by everybody on the site.

因此,每个客户每秒都会收到其他所有客户编号.

So every second every client receives every other clients number.

我的解决方案(目前没有意义)

我想过使用 XMPP 和 OpenFire 服务器来执行此操作,但我似乎无法使其与 PHP 一起使用.

I thought of using XMPP and an OpenFire server to do this, but I can't seem to make it work with PHP.

最后问题

  1. 是否有比我概述的方法更好的方法来解决我的问题?另一种协议之类的?

  1. Is there a better way to solve my problem than the one I outlined? Another potocol or something?

有没有什么东西可以很好地与 OpenFire 配合使用

Is there something that'll play nicely with OpenFire

我已经看过这些

http://code.google.com/p/xmpphp/

https://github.com/tong/hxmpp/

推荐答案

祝大家新年快乐,

XMPP,是处理通知问题的最常用方法,但您可以使用较轻的方法(技术)来处理您的问题,即 Pushlets,并且可以肯定前面的链接不是唯一的.Pushlets 区域基于 servlet 的机制,其中数据从服务器端直接推送到客户端浏览器内的(动态)HTML 页面.这允许服务器定期更新网页.并且肯定比 XMPP 轻得多.

XMPP, is the most common way with dealing with notifying problems, but yet you can use a less heavy approach (Technique) to deal with your problem which is Pushlets, and for sure the previous link is not the only one. Pushlets area servlet-based mechanism where data is pushed directly from server-side to (Dynamic) HTML pages within a client-browser. This allows a web page to be periodically updated by the server. and sure it's much lighter than XMPP.

你也可以像在这里中一样将它与Java服务器端一起使用,这会给你一些新的想法.

you can also use it with Java server side like in Here, which will give you some new ideas.

无论如何,如果您有一个拥有大量用户的 Web 应用程序,那么您必须三思而后行.并确保 XMPP 为您提供针对许多请求的许多控制功能.当 pushlet 足以进行广播时.

anyways, if you have a web application which has a lot of users you have to think twice then. and make sure that XMPP gives you a lot of controlling features over many requests. When pushlet is good enough to do your broadcasting.

希望能帮到你.

这篇关于XMPP for PHP(怎么做)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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