comet

Long polling with NSURLConnection

自古美人都是妖i 提交于 2019-11-30 08:31:33
I'm working on an iPhone application which will use long-polling to send event notifications from the server to the client over HTTP. After opening a connection on the server I'm sending small bits of JSON that represent events, as they occur. I am finding that -[NSURLConnectionDelegate connection:didReceiveData] is not being called until after I close the connection, regardless of the cache settings I use when creating the NSURLRequest . I've verified that the server end is working as expected - the first JSON event will be sent immediately, and subsequent events will be sent over the wire as

Best solution for Java HTTP push (messaging) [closed]

99封情书 提交于 2019-11-30 08:17:22
We want to push data from a server to clients but can only use HTTP (port 80). What is the best solution for messaging? One idea is Comet . Are there other ideas or frameworks which offer lets say JMS over HTTP. (Yes, ActiveMQ supports it too, but waggly IMHO. And JXTA supports it too but the configuration is complicated. Something simple is preferred.) The simplest solution for many, many reasons is to use a Comet based approach (like you mention). This means the clients (to whom you want to "push" messages) open long-lived HTTP connections. Those connections stay open until they time out or

Indicate to an ajax process that the delayed job has completed

久未见 提交于 2019-11-30 06:50:22
问题 I have a Rails 3 app that uses delayed_job to fetch some data (with a class method) when the user hits the page. How can I indicate to the ajax process that the class method has run (so that I can stop polling)? EDIT: To clarify, I want to know when the delayed_job has run, not when the ajax process has succeeded. Then I want to pass the delayed_job completed status to the running ajax process. 回答1: Typically, the best way to do this is to store, in your database, an indication of the job's

How does GMail implement Comet?

孤人 提交于 2019-11-30 06:23:32
问题 With the help of HttpWatch, I tried to figure out how GMail implements Comet. I login in to GMail with two accounts, one in IE and the other in Firefox. Chatting in GTalk in GMail with some magic words like "WASSUP". Then, I logoff both GMail accounts, filter any http content without "WASSUP" string. The result shows which HTTP request is the streaming channel. (Note: I have to logoff. Otherwise, never-ending HTTP would not show content in HttpWatch.) The result is interesting. The URL for

实现数据库更新时前端页面实时刷新

安稳与你 提交于 2019-11-30 06:12:26
https://blog.csdn.net/fengguangle/article/details/78019880 问: 难道只能设置定时器每隔一秒通过 Ajax 向后台请求数据来实现吗? 答: 1、 nodejs的 http://socket.io 支持上述 李宏训 所说的三种方式,另外还支持 Flash Socket、隐藏IFrame、JSONP Polling等方式。http://Socket.io提供前端和服务器端的配套机制,并兼容各种浏览器,它的前端js模块会判断浏览器的能力,自适应选择最合适的Comet方式。 2、 我知道有三种方式: 1,ajax短连接:客户端每隔一秒钟发一次请求,服务器收到请求后会立刻返回结果,不管有没有新数据。 2,ajax长连接:客户端发送一次请求,服务器端收到请求后查询有没有新数据,如果没有新数据就阻塞这个请求,直到有新数据或者超时为止。客户端每次收到请求返回结果后立刻再发一次请求。comet貌似就是这个原理。 3,WebSocket:这就不是一个HTTP协议了,而是一个tcp协议,而且Socket这个玩意顾名思义就是一个流了,可以双向操作。缺点是有些浏览器不支持。 对比延迟: 假设网络延迟是m毫秒,那么ajax短连接的延迟在m到1000毫秒之间,另外两种基本只有m毫秒的延迟。 对比资源占用: 应该是1>2>3。但是1和2的比较要看情况

C# HttpWebResponse Comet problem

风格不统一 提交于 2019-11-30 05:15:32
问题 I am wondering how I would go about reading a persistent connection with HttpWebRequest and HttpWebResponse. The problem seems to be that the GetResponseStream() function waits for the server connection to be closed before returning. Is there an alternative easy way to read a comet connection? Example that doesn't work. // get the response stream Stream resStream = response.GetResponseStream(); string tempString = null; int count = 0; do { // fill our buffer count = resStream.Read(buf, 0, buf

How To Implement ReverseAJAX (Comet) in ASP.Net MVC

喜夏-厌秋 提交于 2019-11-30 05:15:30
How could I implement a Comet architecture in a ASP.Net MVC? SDReyes The paid alternative There are great comments about the question in this thread . And based in the fact you can use handlers in a MVC app: WebSync will do the work : ) As long as you need to implement server push support onto your ASP.NET MVC application you will need some extra functionalities like detection of client status etc. I suggest you to try PokeIn comet ajax library which you can find sample project here I doubt you will find something out of the box for MVC but you can always implement the client side code that

GWT / Comet: any experience?

陌路散爱 提交于 2019-11-30 04:04:43
Is there any way to "subscribe" from GWT to JSON objects stream and listen to incoming events on keep-alive connection, without trying to fetch them all at once? I believe that the buzzword-du-jour for this technology is "Comet". Let's assume that I have HTTP service which opens keep-alive connection and put JSON objects with incoming stock quotes there in real time: {"symbol": "AAPL", "bid": "88.84", "ask":"88.86"} {"symbol": "AAPL", "bid": "88.85", "ask":"88.87"} {"symbol": "IBM", "bid": "87.48", "ask":"87.49"} {"symbol": "GOOG", "bid": "305.64", "ask":"305.67"} ... I need to listen to this

Does facebook use comet or long polling for getting new stream and messages?

帅比萌擦擦* 提交于 2019-11-30 03:32:44
问题 I would like to know if there are any code references that I can follow to write a very simple example. Many posts or websites just talk about the technology. 回答1: Yes "it's a variation of Comet , specifically XHR long polling , and/or BOSH ." reference site: https://www.facebook.com/note.php?note_id=14218138919 来源: https://stackoverflow.com/questions/9579843/does-facebook-use-comet-or-long-polling-for-getting-new-stream-and-messages

Web Chat Application - ASP.NET/Jabber/Ajax/WCF/Comet/ReverseAjax - Issues Faced - Seeking Insights

主宰稳场 提交于 2019-11-29 21:40:14
问题 I've been trying to build a web based chat application for the past three weeks and i'm facing issues with whatever route (programming technique/technology) i take to build it. I've explained the issues i've experienced with all of'em below. Kindly provide whatever insights you have in this. ASP.NET-AJAX First issue is that it is Not Really Real Time If client hits the chat server every x seconds (constant time stamp) it is not going to be real time unless x is very very less If x is very