comet

My Understanding of HTTP Polling, Long Polling, HTTP Streaming and WebSockets

醉酒当歌 提交于 2019-12-17 22:03:17
问题 I have read many posts on SO and the web regarding the keywords in my question title and learned a lot from them. Some of the questions I read are related to specific implementation challenges while others focus on general concepts. I just want to make sure I understood all of the concepts and the reasoning why technology X was invented over technology Y and so on. So here goes: Http Polling: Basically AJAX, using XmlHttpRequest. Http Long Polling: AJAX but the server holds on to the response

Timeout behavior of different browsers?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-17 20:00:20
问题 I am writing an on line chat room based on AJAX/COMET. My design is: Request ----------------- wait -------------------------> send dump data ----------------- wait -------------------------> send dump data ----------------- wait -------------------------> send dump data ----------------- wait -------------------------> send dump data ----------------- wait -------------------------> send dump data ------ something happened, get response. Another request ..... .... As you see, the server hold

How to implement event listening in PHP

坚强是说给别人听的谎言 提交于 2019-12-17 17:59:10
问题 here is my problem: I have a script (let's call it comet.php) whic is requsted by an AJAX client script and wait for a change to happen like this: while(no_changes){ usleep(100000); //check for changes } I don't like this too much, it's not very scalable and it's (imho) "bad practice" I would like to improve this behaviour with a semaphore(?) or anyway concurrent programming technique. Can you please give me some tips on how to handle this? (I know, it's not a short answer, but a starting

Choosing and deploying a comet server

巧了我就是萌 提交于 2019-12-17 17:48:24
问题 I want to push data to the browser over HTTP without killing my django/python application. I decided to use a comet server, to proxy requests between my application and the client (though I still haven't really figured it out properly). I've looked into the following engines: orbited cometd ejabberd jetty Has anyone had any experience working with these servers and deploying them? Any insight and links regarding the topics would be great. Thank you. 回答1: I would recommend looking into Twisted

Cross-browser implementation of “HTTP Streaming” (push) AJAX pattern

巧了我就是萌 提交于 2019-12-17 15:31:35
问题 Client request web page from server. Clent then requests for extra calculations to be done; server performs series of calculations and sends partial results as soon as they are available (text format, each line contains separate full item). Client updates web page (with JavaScript and DOM) using information provided by server. This seems to fit HTTP Streaming (current version) pattern from Ajaxpatterns site. The question is how to do it in cross-browser (browser agnostic) way, preferably

Stopping a iframe from loading a page using javascript

与世无争的帅哥 提交于 2019-12-17 09:39:53
问题 Is there a way in javascript of stopping an iframe in the middle of loading a page? The reason I need to do this is I have a background iframe streaming data from a web server (via a Comet style mechanism) and I need to be able to sever the connection at will. Any ideas welcome. 回答1: For FireFox/Safari/Chrome you can use window.stop(): window.frames[0].stop() For IE, you can do the same thing with document.execCommand('Stop'): window.frames[0].document.execCommand('Stop') For a cross-browser

Javascript implementation of WS-I Reliable Secure Profile

感情迁移 提交于 2019-12-17 07:52:20
问题 I'm using the .NET 4 server side implementation of Reliable Secure Profile for HTTP/S push and want to know if there is a JavaScript client available. 回答1: No. There are several generic SOAP libraries to talk to web services but not one that is specifically geared towards WS-I or the RSP definition. It might make for a good open source project though. Please add info here if you start it up, others might like it :) 来源: https://stackoverflow.com/questions/5724558/javascript-implementation-of

Django / Comet (Push): Least of all evils?

旧时模样 提交于 2019-12-17 05:36:38
问题 I have read all the questions and answers I can find regarding Django and HTTP Push. Yet, none offer a clear, concise, beginning-to-end solution about how to accomplish a basic "hello world" of so-called "comet" functionality. First question (1): To what extent is the problem that HTTP simply isn't (at least so far) made for this? Are all the potential solutions essentially hacks? 2) What's the best currently available solution? Orbited? Some other Twisted-based solution? Tornado? node.JS?

WebSockets protocol vs HTTP

旧时模样 提交于 2019-12-17 01:22:13
问题 There are many blogs and discussions about websocket and HTTP, and many developers and sites strongly advocate websockets, but i still can not understand why. for example (arguments of websocket lovers): HTML5 Web Sockets represents the next evolution of web communications—a full-duplex, bidirectional communications channel that operates through a single socket over the Web. ( http://www.websocket.org/quantum.html ) HTTP supports streaming: request body streaming(you are using it while

How to transfer data structures between browser and server

笑着哭i 提交于 2019-12-13 15:07:21
问题 In the context of interactive web apps, especially those libraries utilizing technologies such as websockets, how can we transfer data structures (e.g. maps, lists, sets, etc) between the client browser and the server? The examples I've come across so far only pass strings. Is this supported case by case dependent on the libraries used, or a more general mechanism is available? 回答1: You can send three things over a websocket (from the client perspective): Strings ArrayBuffers Blobs If you