最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - Real time web update client to client - Stack Overflow

programmeradmin1浏览0评论

I'm so curious real time web application like Facebook uses (eg. Friends Notifications) My question is what particular javascript code or existing framework I can use if theres any existing out there. Regards

I'm so curious real time web application like Facebook uses (eg. Friends Notifications) My question is what particular javascript code or existing framework I can use if theres any existing out there. Regards

Share Improve this question asked Jun 14, 2013 at 4:51 Bruce Elenois McGravy Bruce Elenois McGravy 871 silver badge6 bronze badges 1
  • Take a look at Comet (en.wikipedia/wiki/Comet_(programming)). There's SignalR for .NET – Jude Cooray Commented Jun 14, 2013 at 4:53
Add a ment  | 

10 Answers 10

Reset to default 1

Also have a look at websockets.

A description: http://www.html5rocks./en/tutorials/websockets/basics/

And a framework to use: http://socket.io/

That technique called as server push.Among them Comet is widley used and for PHP

Pusher – Who I work for-

Here is the real time list

Messaging: with focus on delivery to clients (e.g. Web Browsers)

The easiest way to access this technology is to use a framework. We have used http://www.pusher. in some projects with good results.

This project is very nice, too:

http://socketo.me/

and its pure php

also have look at this its long polling its very simpele but its not better then socket.io http://www.screenr./SNH

There is http://www.asp/signalr, it uses the best service for the connection, e.g. If websocket is available, then it'll use websocket, othwerwise it will use other techniques like polling (the worst technique).

Another one is http://nodejs/, I don't know how it works, but it seems a good option. I think it uses websocket too.

Facebook Friends Notifications uses push technology.

Push, or server push, describes a style of Internet-based munication where the request for a given transaction is initiated by the publisher or central server. It is contrasted with pull, where the request for the transmission of information is initiated by the receiver or client.

You can read more about the way it works technically using Comet following this link.

Another solution is AngularJS (http://anuglarjs). This is a newer technology developed by someone within Google and seems to hold many promises in web application development.

Meteor JS is also a nice library for realtime updates.

I would advice you to use setinterval() in JS, and an ajax function to check if there are new messages in your database (not seen by the current user), if so show them as new. PP: you'll need to get to know some jquery and php, but overall creating it yourself gives you all the flexibility and a lot easier bug fixing

发布评论

评论列表(0)

  1. 暂无评论