comet

PHP + Comet (long-polling) scaling / hosts

寵の児 提交于 2019-12-04 22:32:22
问题 I have developped an application using PHP/MySQL which used comet technology, presicely long-polling. The proof of concept works great, but I am expecting traffic to quickly reach thousands of simultanous connections = thousands of open connections on the webserver. I do not have the ability to setup my own server (e.g. using lighttpd), and usually rely on simple 5$/month PHP hostings for other web projects. However, I realize those won't do the trick as they are not meant to support such a

AJAX/Reverse AJAX: Polling or Push?

痞子三分冷 提交于 2019-12-04 21:20:33
问题 Been studying a ton on AJAX because I'm making a real-time application out of Javascript and PHP. It needs to be able to update without refreshing the page and in real-time. I tried polling the server with setInterval() but for it to be quick I had to have it every second. It seems to be using a ton of bandwidth though. It does work however and I have a plan with my hosting provider for 'unlimited bandwidth'. It seems like a lot of stress on the site though so I wanted to use a Push

Server push: comet vs ape?

妖精的绣舞 提交于 2019-12-04 20:45:26
问题 I've read a little about comet and also APE. Which one is better? I want the users to see other users updated content. Like Google Wave. And in comet, there are 2 versions: iframe vs traditional ajax. what is the difference and which is better. I dont quite understand it. Thanks. 回答1: Comet is a set of techniques useful for developing realtime applications. You have two main implementations: streaming and long polling. In regular http requests the user sends the request to the server,

Python + comet + web (chat) - I need working(!) library/server

ⅰ亾dé卋堺 提交于 2019-12-04 20:10:59
I need working (cross-browser) project (library/server) to build web-chat in comet technology. There are: orbited, orbited2, hookbox, but it seems that are no longer developed (also projects sites are down) and have a lot of bugs. Any ideas? Thanks for help! Have a look at Tornado a simple non-blocking webserver written in Python by the facebook team. The comet behavior can be done with tornadio which makes possible to use socket.io javascript lib with tornado. There is a chat example in tornadio that may look like what you are looking for. I 've tested it successfully with IE6, Firefox,

Finishing a HttpServletResponse but continue processing

痴心易碎 提交于 2019-12-04 19:51:19
问题 I have a situation that seems to fit the Async Servlet 3.0 / Comet situation but all I need to do is return a 200 response code (or other) after accepting the incoming parameters. Is there a way for a HttpServlet to complete the http request/response handshake and yet continue processing? Something like... doPost( req, response ) { // verify input params... response.setStatus( SC_OK ); response.close(); // execute long query } EDIT: Looking at the javax.servlet package - the proper phrasing

Cometd with glassfish

南笙酒味 提交于 2019-12-04 19:20:04
I have been trying tp get cometd http://cometd.org/ to work with glassfish server, but I couldn't run the chat sample, seems I'm missing some libraries I found this in the glassish documentation http://docs.sun.com/app/docs/doc/820-4496/ggrgt?a=view But this doesn't give much, no subscribe and publish as found in Cometd example with Jetty, just long polling If I'm using cometd, must I use jetty server ? Don't know if you had any luck with this in the last 6 month, but I came across the following: http://developers.sun.com/appserver/reference/techart/cometslideshow.html Exract: To use Comet

How many child_processes should I fork() in node.js?

无人久伴 提交于 2019-12-04 18:53:02
问题 My question is quite simple. though, it may require different variable to be answered (i guess) I'm playing around with node.js and I'm thinking of how to use it in a multi core architecture. Latest version provides child_process.fork() and child.spawn() methods for multi-process programming. I've read on this very good (but dated) article about using Node.js as a large-scale Comet server. Now then nodejs provides multi-process programming, I really have no idea about how many processes

CometD publish a message back to a client

坚强是说给别人听的谎言 提交于 2019-12-04 17:56:46
I am having a problem in sending back a message to a client. Below is my code JavaScript dojox.cometd.publish('/service/getservice', { userid : _USERID, }); dojox.cometd.subscribe('/service/getservice', function( message) { alert("abc"); alert(message.data.test); }); Configuration Servlet bayeux.createIfAbsent("/service/getservice", new ConfigurableServerChannel.Initializer() { @Override public void configureChannel(ConfigurableServerChannel channel) { channel.setPersistent(true); GetListener channelListner = new GetListener(); channel.addListener(channelListner); } }); GetListener class

反向Ajax,第1部分:Comet介绍

谁说我不能喝 提交于 2019-12-04 17:13:29
在过去的几年中,web开发已经发生了很大的变化。现如今,我们期望的是能够通过web快速、动态地访问应用。在这一新的文章系列中,我们学习如何使用反向Ajax(Reverse Ajax)技术来开发事件驱动的web应用,以此来实现更好的用户体验。客户端的例子使用的是JQuery JavaScript库,在这首篇文章中,我们探索不同的反向Ajax技术,使用可下载的例子来学习使用了流(streaming)方法和长轮询(long polling)方法的Comet。 前言 web开发在过去的几年中有了很大的进展,我们已经远超了把静态网页链接在一起的做法,这种做法会引起浏览器的刷新,并且要等待页面的加载。现在需要的是能够通过web来访问的完全动态的应用,这些应用通常需要尽可能的快,提供近乎实时的组件。在这一新的由五部分组成的文章系列中,我们学习如何使用反向Ajax(Reverse Ajax)技术来开发事件驱动的web应用。 在这第一篇文章中,我们要了解反向Ajax、轮询(polling)、流(streaming)、Comet和长轮询(long polling),学习如何实现不同的反向Ajax通信技术,并探讨每种方法的优点和缺点。你可以下载本文中例子的相应源代码。 Ajax、反向Ajax和WebSocket 异步的JavaScript和XML(Asynchronous JavaScript and

Keeping a jQuery .getJSON() connection open and waiting while in body of a page?

余生颓废 提交于 2019-12-04 17:00:13
I'm writing a basic push messaging system. A small change has caused it to stop workingly properly. Let me explain. In my original version, I was able to put the code in the of a document something like this: <head> ...text/javascript"> $(document).ready(function(){ $(document).ajaxStop(check4Updates); check4Updates(); }); function check4Updates(){ $.getJSON('%PATH%', callback); }; ... </head> This worked nicely and would keep the connection open even if the server return null (which it would after say a 2 minute timeout). It would just keep calling the getJSON function over and over