long-polling

Further question on segmenting AJAX responses

This question is related to one I asked previously, see here. As a way to implement segmented ajax responses, I created a code which does this: The client first calls the script which initializes the process. On the server side, the startScript.cgi code starts generating data, and as it does this, it groups the responses into chunks, a...

How to write a simple server-push implementation in Python using django?

Hello, I would like to write a simple server-push implementation either using long pooling or comet that integrates into the server. I don't want to use a networking framework like twisted because I want to learn how everything is done internally. What exactly should I learn? What specifications should I look at? I prefer something that ...

is this chat script efficient?

i made a chat using php and ajax, and i am using a while loop to check the database for new messages. this is the code that retrieves the message: //retrive message function update(){ $(document).ready(function(){ $.ajax({ async: true, type: "POST", url: "listen.php", success: function(data){ $("#myp").before(data); }, comple...

Using HTTP long polling when sockets are available (e.g. iPhone, Blackberry)

I'm currently writing a simple cross platform app with Node.js on the server and web/iPhone/Blackberry clients. Bandwidth and latency requirements are similar to something you would see in an IRC "party game" or any chat system. I've developed the web client using http long polling (speaking JSON both ways). For iPhone/blackberry I coul...

Comet-style messaging: How to implement server part without polling?

I'm planning a chat-like web application, where whenever one user posts something, all other users (that is, people with their browser pointing to that site) would get instant updates. The common choice for this is comet-style messaging using long-polling AJAX requests. Writing the client-side part with jQuery isn't much of a problem. ...

How do I keep FireFox from “spinning” with a long-polling request?

I'm using the following for a long-polling request (this is a plugin similar to getJSON)... $.jsonp({ "url": url, "data": { "settings", settings }, "success": function(userProfile) { // handle user profile here }, "error": function(d,msg) { alert("Could not find user "+userId); } }); The request won't ...

Problem with long polling with JQuery on Tomcat Server

I created a CometServlet according to this example http://tomcat.apache.org/tomcat-7.0-doc/aio.html. Then I tried to get data from it using JQuery. The code is following: $(function() { $.longPoll = function(url, success, error) { $.ajax({ url : url, success: function(data, status) { ...

Is long polling possible in Google App Engine?

I need to make application that needs to poll server often, but GAE has limitations on requests, so making a lot of requests could be very costly. Is it possible to use long polling and make requests wait for the maxium 30 seconds for changes? ...

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 script is just getting the variables, construction of the query and the json response obj...

Missing comet events on Tomcat 7 CometProcessor

I am using CometProcessor to implement long-polling on Tomcat 7.0. The thing that bothering me is I don't get any other events except CometEvent.EventType.BEGIN. The code sample: @Override public void event(CometEvent event) throws IOException, ServletException { HttpServletRequest request = event.getHttpServletRequest(); ...

Jquery Ajax calls crashing Internet Explorer?

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 ...

How best to implement the polling consumer pattern in JavaScript

Background Back in May I reported an issue on WebKit regarding a memory retention issue. It looks as though the problem could be due to the Web Inspector itself, but I'm not convinced yet. Problem A problem surfaced whereby my JavaScript application implements a "Polling Consumer" pattern for obtaining data as it becomes available. Th...

MySQL trigger + notify a long-polling Apache/PHP connection

I know there are Comet server technologies that do this but I want to write something simple and home-grown. When a record is inserted into a MySQL table, I want it to somehow communicate this data to a series of long-polled Apache connections using PHP (or whatever). So multiple people are "listening" through their browser and the sec...

Is it safe to assume constant IP address with a COMET server implementation?

Our website uses an in-house implemented long-polling COMET server to communicate with the web-page on the client machine. A Connection object manages the requests and responses for a single client. The Connection object can live for many hours and deal with several hundred requests from the same client, while they remain "connected" to ...

jsonp comet hanging request causes ugly "loading" status on browsers

I'm using jsonp to do cross-domain comet requests, and the "loading" status is really annoying. Is there any way to suppress this with javascript? For those who are unfamiliar with jsonp, it basically injects a script tag, except in my case, I'm hanging the request on my server without returning the request until a later time. During ...

Implementing long polling with SOAP-based @Stateless EJB exposed as @WebService

I have a pre-existing SOAP-based web service with which I'd like to provide a long-polling based notification system. How can I implement this? The client is currently a Java desktop rich client which must receive updates from other connected clients. The server is GlassFish 3.01. I had a basic, blocking @WebMethod but I had problems res...

Ajax long-polling on IIS

I am looking into making a real-time chat website, but have ran into a few questions before starting. First off, we want to be able to have multiple people in one conversation and multiple conversations going on at the same time. After doing some research, a lot of people suggested long-polling. Scalability sounds like a problem thoug...

AJAX Polling Frequency - To long poll or not to long poll?

I'm building a component of a web page that needs relatively constant database polling. I can see two different approaches for this, and I'm wondering if one of them is better than the others, or if I'm missing a third option. 1) Send off an AJAX request every 1 or 2 seconds to check for updates. Each request returns immediately whether...

How can wait for events with Tornado and then pushing them back to user's web-browser trough long-polling?

I want the events to be arbitrary events, for example: "User answered X", "User P sent you a message with Q". ...

How to prevent webkits constant url loading url / throbber of doom

There is a few questions about this, but mostly lacking details and no definitive answer. So I am using xhr long polling, my poll is pretty basic and just looks like var poll = function() { $.get(url, function(data) { doStuff(data); poll(); }); }; I start that from a script that is imported just before , I remove absolu...