long-polling

Nginx + PHP: stop process at canceled request

白昼怎懂夜的黑 提交于 2019-11-29 11:31:41
问题 I have Nginx 1.4.4 and PHP 5.5.6. I'm making long-polling requests. Problem is, that if I cancel the HTTP request sent via Ajax, requests are still processing (they don't stop). I tested it with the PHP mail() function at end of file, and mail is still coming the file didn't stop). I'm worried, because I think that it might cause server crash because of the high load of unclosed requests. Yes, I tried ignore_user_abort(false); but with no changes. Is possible that I should change something in

socket.io server very delayed in registering client disconnects

纵然是瞬间 提交于 2019-11-29 08:43:29
I have a socket.io connection using xhr as its only transport. When I load up the app in the browser (tested in chrome and ff), the socket connects and everything works well until I navigate away from the page. If I reload the browser, I can see the 'disconnect' event get sent out by the client, but the server disconnect event doesn't fire for a very long time (presumably when the client heartbeat times out). This is a problem because I do some cleanup work in the server when the client disconnects. If the client reloads, I get multiple connection events before disconnect is fired. I've tried

How to determine server disconnection from SignalR client?

痞子三分冷 提交于 2019-11-29 02:28:15
问题 The question is how can SignalR JavaScript client detect when connection with server is lost? Thanks for any reply! 回答1: A hub has a method disconnect which will allow you to add a callback when disconnection takes place: myHub.disconnect(function() { alert('Server has disconnected'); }); If you aren't using hubs then the code for the disconnect method will help you out: $(connection).bind("onDisconnect", function (e, data) { callback.call(connection); }); This shows the syntax for hooking

Long Polling with Spring's DeferredResult

我与影子孤独终老i 提交于 2019-11-29 01:56:57
The client periodically calls an async method (long polling), passing it a value of a stock symbol, which the server uses to query the database and return the object back to the client. I am using Spring's DeferredResult class, however I'm not familiar with how it works. Notice how I am using the symbol property (sent from client) to query the database for new data (see below). Perhaps there is a better approach for long polling with Spring? How do I pass the symbol property from the method deferredResult() to processQueues() ? private final Queue<DeferredResult<String>> responseBodyQueue =

Websockets. Loss of internet, keep-alive messages, app architecture etc

别等时光非礼了梦想. 提交于 2019-11-29 00:29:33
问题 Well, there's a lof of information about websockets. The technology itself is amazing, there's no doubt in this fact. And before i will start using them in my app i just want the community to answer these questions: "...in order to maintain presence, the app can send keep-alive messages on the WebSocket to prevent it from being closed due to an idle timeout..." "...ideally a future version of WebSocket will support timeout discovery, so it can either tell the application the period for keep

Amazon SQS Long Polling not returning all messages

我只是一个虾纸丫 提交于 2019-11-28 22:00:11
I have a requirement to read all messages in my Amazon SQS queue in 1 read and then sort it based on created timestamp and do business logic on it. To make sure all the SQS hosts are checked for messages, I enabled long polling. The way I did that was to set the default wait time for the queue as 10 seconds. (Any value more than 0 will enable long polling). However when I tried to read the queue, it still did not give me all the messages and I had to do multiple reads to get all the messages. I even enabled long polling through code per receive request, still did not work. Below is the code I

Tornado blocking asynchronous requests

旧巷老猫 提交于 2019-11-28 17:39:33
Using Tornado, I have a Get request that takes a long time as it makes many requests to another web service and processes the data, could take minutes to fully complete. I don't want this to block the entire web server from responding to other requests, which it currently does. As I understand it, Tornado is single threaded and executes each request synchronously, even though it handles them asynchronously (still confused on that bit). There are parts of the long process that could be pause points to allow the server to handle other requests (possible solution?). I'm running it on Heroku with

Chrome's loading indicator keeps spinning during XMLHttpRequest

扶醉桌前 提交于 2019-11-28 17:29:13
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 because even Google Wave had this behaviour. Well today I noticed that Google Wave no longer keeps the loading icon spinning, anyone know how they fixed this? Here's my ajax call code var xmlHttpReq = false; // Mozilla/Safari if (window.XMLHttpRequest) { xmlHttpReq = new XMLHttpRequest(); } // IE else if (window.ActiveXObject) { xmlHttpReq = new

Is this a true long polling?

夙愿已清 提交于 2019-11-28 14:06:44
问题 After lot of trials,I am successfully able to maintain continous server connection with database. Now code keet cheking and show the messages,if there are new in database. Plz review and tell if there is true long polling technique used in this code? If it is not,then plz suggest,where I am wrong(deviating from long polling) and how this can be made a true long polling. Currenlty,I am getting these errors.However still it maintains the continous connection with database. each time,Only one

Hard downsides of long polling?

笑着哭i 提交于 2019-11-28 09:09:41
For interactive web apps, things like Websockets are getting more popular. However, as the client, and proxy world is not always fully compliant, one usually use a complex framework like 'Socket.IO', hiding several different mechanisms for any case that may disable the other ones. I just wonder what the downsides of a properly implemented long polling are, because with today's servers like node.js it is quite easy to implement and relies on old http technology which is well supported (despite the long polling behaveiour itself may break it). From an high level view, long polling (despite some