PHP即时消息传递方法 [英] PHP instant messaging methods

查看:105
本文介绍了PHP即时消息传递方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想制作一个IM,以便用户可以像聊天一样在同一页面上向彼此发送即时消息.用户可以选择可以看到其消息的人.它用于任务管理.我应该使用的最佳方法是什么?我正在使用php. php套接字对此有用吗?或轮询,Comet,php输出缓冲区或javascript计时器(计时器很简单,但并不快).

I want to make an IM so that user's can send instant messages to each others on the same page like a chat. Users can choose that who can see their messages. Its for task management . What is the best method that I should use for. I'm using php. Is php sockets usefull for this? or Polling, Comet, php output buffer or javascript timer(timer is easy but not fast).

推荐答案

最常用的方法称为这是一个PHP实现:如何使用PHP实现COMET

Here is a PHP implementation: How to implement COMET with PHP

在HTML5规范中,已经有许多浏览器实现了所谓的Websocket.这是一个支持websocket的PHP项目: phpwebsocket .如果浏览器不支持websocket(因此向后兼容),则有一些javascript库可以使用Flash组件

In the HTML5 specification there are something called websockets that many browsers already have implemented. Here is a PHP project supporting websockets: phpwebsocket. There are some javascript libraries which can use a flash component if the browser do not support websockets (and therefore be backwards compatible)

imho webSockets是可行的方法,尽管PHP可能不是最适合处理它们的后端.

imho webSockets is the way to go, although PHP might not be the most suitable backend to handle them.

这篇关于PHP即时消息传递方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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