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...
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 ...
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...
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...
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.
...
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 ...
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) {
...
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?
...
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...
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();
...
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 ...
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...
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...
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 ...
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 ...
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...
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...
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...
I want the events to be arbitrary events, for example: "User answered X", "User P sent you a message with Q".
...
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...