Questions tagged [long-polling]

In web programming, long-polling is an emulation of pushing data, implemented by repeated polling with delayed response.

Long polling is itself not a true push; long polling is a variation of the traditional polling technique, but it allows emulating a push mechanism under circumstances where a real push is not possible, such as sites with security policies that require rejection of incoming HTTP/S Requests.

1099 questions
1184
votes
4 answers

What are Long-Polling, Websockets, Server-Sent Events (SSE) and Comet?

I have tried reading some articles, but I am not very clear on the concepts yet. Would someone like to take a shot at explaining to me what these technologies are: Long Polling Server-Sent Events Websockets Comet One thing that I came across every…
user1437328
  • 15,546
  • 9
  • 34
  • 44
118
votes
2 answers

Differences between websockets and long polling for turn based game server

I am writing a server for an iOS game. The game is turn-based and the only time the server needs to push information to the client is to notify of the opponent's move. I am curious if anyone could comment on the performance and ease of…
acidic
  • 1,497
  • 2
  • 19
  • 23
99
votes
3 answers

Short-polling vs Long-polling for real time web applications?

I'm building a real-time web application As far as I know, the most popular choices are short-polling and long-polling. What are the advantages and disadvantages might there be for measuring one over the other?
Jeff
  • 14,365
  • 8
  • 30
  • 30
83
votes
2 answers

Disable ajaxStart() and ajaxStop() for a specific request

I am using .ajaxStart() and .ajaxStop() to show a modal while an ajax request is being made. (between start and stop) Now I'd like to add a longpoll function that keeps waiting for notifications, similar to the one on the left upper corner of this…
Gung Foo
  • 13,392
  • 5
  • 31
  • 39
82
votes
6 answers

jQuery read AJAX stream incrementally?

I have read this question but it doesn't exactly answer my question. Unfortunately, it looks like things have changed in in the XHR object since I last looked at AJAX, so it is no longer possible to directly access responseText before it is finished…
Josh
  • 4,412
  • 7
  • 38
  • 41
64
votes
2 answers

What technology does Google Drive use to get real-time updates?

What technology does Google Drive use to do real-time? When I type in a Google Drive document that is being accessed by multiple users, the Chrome Developer Tools Network tab shows that there are no WebSockets. I see that the two most frequent types…
Max Heiber
  • 14,346
  • 12
  • 59
  • 97
62
votes
4 answers

Chrome stalls when making multiple requests to same resource?

I'm trying to implement long polling for the first time, and I'm using XMLHttpRequest objects to do it. So far, I've been successful at getting events in Firefox and Internet Explorer 11, but Chrome strangely is the odd one out this time. I can load…
mrdecemberist
  • 2,631
  • 2
  • 20
  • 23
43
votes
3 answers

What is a RESTful way of monitoring a REST resource for changes?

If there is a REST resource that I want to monitor for changes or modifications from other clients, what is the best (and most RESTful) way of doing so? One idea I've had for doing so is by providing specific resources that will keep the connection…
Ross
  • 9,652
  • 8
  • 35
  • 35
40
votes
1 answer

Is SQS short polling ever preferable to long polling?

Amazon SQS supports two modes of polling for available messages: short polling and long polling. With long polling, the consumer specifies a timeout of 1-20 seconds to wait for available messages. According to the documentation: By default, Amazon…
augurar
  • 12,081
  • 6
  • 50
  • 65
34
votes
2 answers

Non-Message Queue / Simple Long-Polling in Python (and Flask)

I am looking for a simple (i.e., not one that requires me to setup a separate server to handle a messaging queue) way to do long-polling for a small web-interface that runs calculations and produces a graph. This is what my web-interface needs to…
aaronlevin
  • 1,433
  • 2
  • 13
  • 18
33
votes
5 answers

How does a WCF server inform a WCF client about changes? (Better solution then simple polling, e.g. Comet or long polling)

see also "WCF push to client through firewall" I need to have a WCF client that connect to a WCF server, then when some of the data changes on the server the clients need to update its display. As there is likely to be a firewall between the…
Ian Ringrose
  • 51,220
  • 55
  • 213
  • 317
31
votes
4 answers

Chrome's loading indicator keeps spinning during XMLHttpRequest

I'm writing an AJAX web app that uses Comet/Long Polling to keep the web page up to date, and I noticed in Chrome, it treats the page as if it's always loading (icon for the tab keeps spinning). I thought this was normal for Google Chrome + Ajax…
Martin Konecny
  • 57,827
  • 19
  • 139
  • 159
29
votes
7 answers

How to determine server disconnection from SignalR client?

How can a SignalR JavaScript client detect when a connection with the server is lost?
Alexandr
  • 695
  • 2
  • 9
  • 18
27
votes
3 answers

polling vs long polling

I got onto these examples showing polling vs long-polling in javascript, however I do not understand how they differ from one another. Especially regarding the long polling example, how does it keep its connection open? This is what the traditional…
Renaud
  • 4,569
  • 7
  • 41
  • 72
25
votes
5 answers

Node.js with Socket.io - Long Polling fails and throws "code":1,"message":"Session ID unknown" response

I'm stuck on why a node.js app that was moved to an IIS7 server is now failing. I know IIS7 doesn't support web sockets but my understanding was that socket.io would fall back to long polling if web socket isn't available. So now when the user tries…
mario
  • 1,503
  • 4
  • 22
  • 42
1
2 3
73 74