long-polling

Long polling in java

故事扮演 提交于 2019-12-04 15:24:11
I have written my server side code for long polling. I want to write the client program in java. So as per long polling, the client sends a request which is help by the server and the server responds to the request when an event occurs and then client sends a new request. So the trouble I am facing is with the client side which is to be written in java. After I send the request, how to keep checking in the client side if the server has responded to it or not. At what intervals should I keep sending the request to the server. I am totally confused. I am quite a beginner to Web technologies. I

Using atmosphere for GWT Comet

我的未来我决定 提交于 2019-12-04 14:00:37
I was looking for a simple framework for implementing Comet for my GWT application. I looked on gwt-rocket which seems to be non active, then on gwt-comet which is not active, then on atmosphere-gwt-comet which was moved into the atmosphere project, and finally - tried to actually download the gwt sample from atmosphere and work with it. :| I added the atmosphere-gwt-server and atmosphere-gwt-client modules (version 0.8.6) to my project and tried to make the existing atmosphere sample to work. I'm getting connection terminated exceptions all the time, and no messages. It seems that example

Long Polling Options: Nginx, PHP, Node.js

微笑、不失礼 提交于 2019-12-04 12:05:09
问题 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 the database. I come very much from a LAMP environment and I'm definitely a developer and not a sys-admin. That said I'm not afraid to try out some new things. I've spent the day researching my options and I'm hoping people can answer some

Simple PHP long polling chat script, too simple?

给你一囗甜甜゛ 提交于 2019-12-04 11:17:26
问题 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 object: $sleepTime = 1; //Seconds $data = ""; $timeout = 0; //Query database for data while(!$data and $timeout < 10){ $data = getQuery($sql); if(!$data){ //No new

Recommended alternative to webkit for server-sent events on iOS [closed]

这一生的挚爱 提交于 2019-12-04 10:30:02
Closed. This question is off-topic. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I would like to receive Server-Sent Events in my native iOS app however am not using webkit/Safari. From what I've found, NSURLConnection is poor fit as it chunks response . I've also looked at ZTWebSocket library (obviously nice, but I'm seeking SSE, not web sockets). Would CocoaAsyncSocket be appropriate? Or limited to pure TCP Socket communication? I have a sneaking suspicion that I am missing

Why should session_write_close be used in long polling?

柔情痞子 提交于 2019-12-04 09:32:39
问题 I was reading an article about long polling at Nolithius. Under the section PHP sleeps across the entire session , it is written that the session_write_close function should be called in order to prevent the entire session coming to a deadlock. What exactly is meant by deadlock here? Does it mean that without this function, any other page from the same domain opened in the client side won't be able to receive AJAX data from other scripts (like this one) until this one has finished executing

how to close/abort a Golang http.Client POST prematurely

情到浓时终转凉″ 提交于 2019-12-04 05:33:04
I'm using http.Client for the client-side implementation of a long-poll: resp, err := client.Post(url, "application/json", bytes.NewBuffer(jsonPostBytes)) if err != nil { panic(err) } defer resp.Body.Close() var results []*ResponseMessage err = json.NewDecoder(resp.Body).Decode(&results) // code blocks here on long-poll Is there a standard way to pre-empt/cancel the request from the client-side? I imagine that calling resp.Body.Close() would do it, but I'd have to call that from another goroutine, as the client is normally already blocked in reading the response of the long-poll. I know that

Long polling freezes browser and block other ajax request

我怕爱的太早我们不能终老 提交于 2019-12-04 05:06:38
I am trying to implement long polling in my Spring-MVC Web App but it freezes my browser and other request after 4-5 continues AJAX requests.I have no clue whats goin on here is my relevant code. The controller method:(Server Side):- @Asynchronous @RequestMapping("/notify") public @ResponseBody Events notifyEvent(HttpServletRequest request) { Events events = null; try { events = (Events) request.getSession(false).getServletContext().getAttribute("events"); System.out.println("Request Came from" + ((com.hcdc.coedp.safe.domain.User) request.getSession(false).getAttribute(Constants.KEY_LOGGED_IN

How does fallback work with socket.io?

梦想与她 提交于 2019-12-04 03:16:48
I'd like to use WebSocket with Java . Problem is, my server is separated from the client by a proxy that cannot be configured. I've been searching for implementations of WebSocket with fallbacks such as long-polling . I've found socket.io but don't know how the fallback works. Under which case does it replace WebSocket and how? Are there other libraries like socket.io with fallbacks implementations? I would like to find one in Java , but I only found Jetty . EDIT: does the fallback only depend on the browser's compatibility with WebSocket? What if the cause of failure is a proxy badly

Node.js with Socket.io - Long Polling fails and throws “code”:1,“message”:“Session ID unknown” response

女生的网名这么多〃 提交于 2019-12-04 00:45:56
问题 I'm stuck on why a node.js app that was moved to an IIS7 server is now failing. I know IIS7 doesn't support web sockets but my understanding was that socket.io would fall back to long polling if web socket isn't available. So now when the user tries to press a specific button which would normally have required the socket or long polling I get something like this: XHR finished loading: POST "https://localhost:817/socket.io/?EIO=2&transport=polling&t=1433777964357-6&sid=QWsESi0c9ih7WMWKAAAC".