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
10
votes
2 answers

EventSource XHR headers

I'm trying to use EventSource for a streaming connection to a server. But I need to set a session key header on the underlying XHR request. How do I access the XHR from the EventSource object if it's even possible? Thanks! Note that I'm not sure if…
ionox0
  • 1,101
  • 2
  • 14
  • 21
10
votes
3 answers

long polling netty nio framework java

How can I do long-polling using netty framework? Say for example I fetch http://localhost/waitforx but waitforx is asynchronous because it has to wait for an event? Say for example it fetches something from a blocking queue(can only fetch when data…
Alfred
  • 60,935
  • 33
  • 147
  • 186
10
votes
1 answer

infinite timeout for reverse proxy in Apache

I am running tornado behind apache. I have created proxy server. ProxyRequests On ProxyPass /chat/ http://localhost:8888/chat/ This code works great and pass all my requests to tornado and returns the response back to client. Now, I am using…
Kunal Singh
  • 199
  • 1
  • 17
9
votes
2 answers

Long Polling with PHP on Apache

Hopefully I can explain this well enough. I am working on creating a PHP library to handle ajax requests through PHP in an object oriented manner. I am currently pondering a good way to implement a long polling solution but am curious about…
Jeremy Harris
  • 24,318
  • 13
  • 79
  • 133
9
votes
1 answer

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

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.
Mark K.
  • 1,969
  • 2
  • 16
  • 15
9
votes
2 answers

Long-polling vs websocket when expecting one-time response from server-side

I have read many articles on real-time push notifications. And the resume is that websocket is generally the preferred technique as long as you are not concerned about 100% browser compatibility. And yet, one article states that Long polling -…
Edgar Navasardyan
  • 4,261
  • 8
  • 58
  • 121
9
votes
2 answers

Python requests sometimes freezes

I have a Python program which sends several (about 5-6) long poll requests in parallel using different threads for each poll via requests package. And I realized that some of my threads sometimes just freeze. When this happens, the server I am…
Canol Gökel
  • 1,168
  • 2
  • 13
  • 29
9
votes
1 answer

Angularjs long polling

I am trying to perform a simple long poll request in Angularjs - I make a GET request and it hangs on till the server responds. Then I make the request again and wait for the next response - and so on. However, for some reason the code is quite…
jitin
  • 732
  • 8
  • 17
9
votes
4 answers

Asynchronous COMET query with Tornado and Prototype

I'm trying to write simple web application using Tornado and JS Prototype library. So, the client can execute long running job on server. I wish, that this job runs Asynchronously - so that others clients could view page and do some stuff…
grundic
  • 4,641
  • 3
  • 31
  • 47
9
votes
1 answer

Doesnt http Keep-Alive solve the issue that long-polling solves?

What exactly is the difference between long polling and http Keep-Alive?? Doesnt http Keep-Alive solve the issue that long-polling solves??
vivek2k6
  • 119
  • 8
8
votes
2 answers

Long Polling Options: Nginx, PHP, Node.js

I'm designing a long-polling app to broadcast small changes very rapidly to, possibly, a large number of users. The app will run in tandem with a website running a fairly standard cms. They'll both be running on one server, and to begin with so will…
thelastshadow
  • 3,406
  • 3
  • 33
  • 36
8
votes
2 answers

Long Polling in Angular 4

I need to do API calls to display the progress of something. I have created a service which does this every 1.5 seconds Main Component private getProgress() { this.progressService.getExportProgress(this.type, this.details.RequestID); …
Nicolas
  • 4,526
  • 17
  • 50
  • 87
8
votes
1 answer

Manually set transport type on a Spring + Sockjs application

I need to install an application on a non JEE7 compliant server. I am using Spring + Stomp + SocksJs for realtime notifications. My code looks like this: @Configuration @EnableWebSocketMessageBroker public class WebSocketConfig extends…
pallendes
  • 95
  • 1
  • 1
  • 9
8
votes
2 answers

Longpolling vs Websockets

I start developing a software, app coded using html + js I need to send this app notification from the server (java code) the app using nginx for routiong and is hosted in AWS. I investigated this subject of real time notification and I get confused…
Ortal Blumenfeld Lagziel
  • 2,415
  • 3
  • 23
  • 33
8
votes
4 answers

Simple PHP long polling chat script, too simple?

Im working on a simple chat app, probably 10 to 20 users per room. The Script that queries the database for new messages looks too simple for all the request it'll be getting. Below is the block of code that loops for new messages, the rest of the…
Pablo
  • 5,897
  • 7
  • 34
  • 51