problem about long-polling-Collection of common programming errors


  • Florian Peschka
    php ajax performance long-polling
    When using long polling in PHP, e.g.$start_time = time(); while ((time() – $start_time) < 30) { if ($db->getNewStuff()->rows > 0) {$response = “new stuff!”;break; } usleep(1000000); } echo $response;How do you evaluate, how “long” you “poll”? In this example, I chose 30 seconds, because… well, I can’t even tell why.What are the impacts when using even longer polls, several minutes or alike? Will Apache crash? Will my application get laggy / stuck / decrease performance?Furthermore:

  • Michael Petrotta
    php nginx long-polling
    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 Ngi

  • xaxa
    node.js heroku long-polling
    I want to make an application on Heroku using node.js to display various statistics.This means that requests can take a long time to complete (more than standard 30 secs). 1. How can I increase the timeout interval so that my app wouldn’t crash on request timeout? 2. How can I make long-poll requests to gradually stream data to client as long as it’s being processed on server?Thank you.

  • Bitsian
    node.js websocket socket.io long-polling
    I am new to socket.io. So my socket.io server sometimws crashes giving this below error timers.js:103if (!process.listeners(‘uncaughtException’).length) throw e;^ Error: socket hang upat createHangUpError (http.js:1360:15)at ServerResponse.OutgoingMessage._writeRaw (http.js:507:26)at ServerResponse.OutgoingMessage._send (http.js:476:15)at ServerResponse.OutgoingMessage.write (http.js:749:16)at XHRPolling.doWrite (E:\sitesroot\0\node_modules\socket.io\lib\transports\ xhr-polling.js:67:17)at XHRPo

  • Sylvan
    jquery internet-explorer crash polling long-polling
    I must admit, this is my first post on this site, so I apologise in advice if I do something wrong (formatting etc). Anyway, I’m creating a kind of mmo using javascript (and jQuery), and so far everything is running fine in Chrome, Safari, Firefox, etc. However, I’ve found that somewhere along the line, Internet Explorer crashes. By reproducing the crash I’ve narrowed it down to this code:function getUpdates(){ var data={uid:playerName,area:1,mid:lastMessage}; $.ajax({ url: “getUpdates.py”, time

  • noob-foreva
    asp.net csv iis6 long-polling ihttpasynchandler
    I have developed a live scoring application which is based on the long polling approach, or Comet as they also call it. I have used ASP.NET 4.0 running on IIS 6 (windows 2003 – only two CPUs, which does not help me much with the availability of threads in the pool).The data is coming in in the form of .csv files that are pasted to the source folder on the web server, which I then import with the use of Microsoft JET 4.0 OleDb Provider, and display utilizing different methods, depending on the pa

  • Prashant Borde
    python django long-polling orbited
    I am trying to run test project of django-orbited (link: http://code.google.com/p/django-orbited/). When I execute command ‘python manage.py runserver’ following error occurs:Unhandled exception in thread started by <bound method Command.inner_run of <django.core.management.commands.runserver.Command object at 0x8ea994c>> Traceback (most recent call last):File “/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py”, line 92, in inner_runself.validate(di

  • scanales
    node.js websocket socket.io long-polling flashsocket
    I’m struggling to get my socket.io app to work on ie < 9 on Win XP.It works perfectly with Win7 ie8, and all other browsers (FF, Chrome, Safari, IE> 8).After loading my script, the server never receives the connect event, though SOMETIMES with log level 3, I get a “handshake authorized “, but not sure when this is happening….My server configuration is as follows:io.set(‘match origin protocol’, true); io.set(‘origins’ , ‘*:*’); io.set(‘browser client

  • rpophessagr
    javascript wordpress wordpress-plugin-dev long-polling
    I am building a WordPress plugin. The plugin works beautifully on one site. But on every other site I’ve tried so far one of the resource files used it getting a 404 (Not Found) error in the console. If I post the url, displayed in the console as not found, in the address bar the file is accessible.The site it works on is not in a root directory, while one it doesn’t work on is on the same server, in the root directory and is a multisite installation. I’ve tried it on other servers, and sometime

  • Florian Peschka
    jquery ajax xmlhttprequest long-polling
    I have a long polling request on my page. The script on the server side is set to timeout after 20 seconds.So, when the long polling is “idling”, and the user presses another button, the sending of that new request is delayed until the previous script times out.I can’t see anything wrong with the code on jQuery side. Why is the onclick-event delayed?function poll() { $.ajax({url: “/xhr/poll/1”,data: {user_id: app.user.id},type: “POST”,dataType: “JSON”,success: pollComplete,error: function(respon

  • Strik3r
    jquery-ajax nginx long-polling
    Recently I have been trying to set up a comet server for my application on a Ngnix server using this plugin:https://github.com/wandenberg/nginx-push-stream-moduledue to the restrictive nature of GNU/GPL I am unable to use the JS provided with the plugin, so I am trying to implement it on my own using jquery ajax requests.my Nginx config looks like this:location /channels-stats {# activate channels statistics mode for this locationpush_stream_channels_statistics;add_header ‘Access-Control-Allow-O

  • greycode
    javascript jquery ajax long-polling
    I am doing some long polling (ajax) and I am looping the following portion of code.. There is code being executed above and below. This code is part of an internal messaging system. A certain portion of the page wil blink when a message arrives. If the user checks the message, it will remove the dash_notify from the JSON response, which needs to turn off the blinking. See below:if (data.dash_notify == ‘1’) {var x = ‘#dash_notif_blink’;function blinking(x) {timer = setInterval(blink, 10);function