long-polling

How to make SignalR behave gracefully in case of disconnection

こ雲淡風輕ζ 提交于 2019-12-10 09:37:45
问题 My application will often be used under fucked up corporate networks (proxy, firewalls, etc.) so I can not rely on sockets and long-polling is practically my only option. Here is my biggest problem with long-polling: Long-polling is disconnected at some point of time I automatically reconnect (accoring to documentation) User clicks something that causes hub method call but connection is not established yet - error happens. Is there any way to synchronize hub method call and reconnection like:

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

倖福魔咒の 提交于 2019-12-09 17:28:05
问题 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

How to do a long polling client in C#?

本秂侑毒 提交于 2019-12-09 01:09:41
问题 I have a C# desktop application, and I consume a web service without problems (wsdl added by "add Service References", so I create an object and call its functions). Now, I want to use long polling techniques but I can't figure how to do this from the client's perspective. How to configure the timeout ? Should I use a thread dedicated to this ? Is there any example for a C# desktop application ? (haven't found any) Thanks, Dam's 回答1: You should be able to configure the timeout on the web

checking mysql for long polling purposes

元气小坏坏 提交于 2019-12-08 13:52:27
问题 I'm trying to do some long polling on my site for notifying users of incoming mail. I would be using mysql for database purposes. Would it be safe to check mysql if there's an update to the table? Would this cause the site to slow down as it will constantly look for an update? How would you even check if mysql is updated? a code would look something like this while($currentTime <= $lastTime){ usleep(10000) clearstatcache(); $sql = mysql_query("SELECT time FROM timestamp WHERE $currentTime =

Sending messages to server with Comet long-polling

陌路散爱 提交于 2019-12-08 06:40:54
问题 What's the best way to send data from client to server? The example code I'm using is from How do I implement basic "Long Polling"? 回答1: Just use XHR to do a POST. One problem is on some browsers you can only have 2 (or some number n) concurrent XHR connections per server. You can work around this by making a queue that lets you post all waiting messages when the current XHR completes, then filling up a new queue until that post completes, and back and forth. 回答2: Sending data to the server

jQuery ajax php long polling

☆樱花仙子☆ 提交于 2019-12-07 15:03:34
问题 I've been trying to get this long polling script to work but I keep getting stuck. This time I have a problem with the ajax request to the server. The php script that serves the data (running the long-poll using a loop and sleep) works perfectly fine but my jQuery script doesn't. So far I've tried using a normal $.ajax() request and a $.post() request to the script however when I do so the entire script stalls. Well the script actually loads like it is supposed to but the page shows that it

Ajax long polling not working correctly

孤人 提交于 2019-12-07 11:02:24
问题 I am developing a simple strangers chat application using long polling in MVC 2. Its works fine in my development machine if i am opening the application different browsers.. i mean if i loaded the application in IE and mozilla, it works fine if i took the appliction in two tabs of a browser (eg:IE) , the long polling are not firing from both tabs.. I mean, there is a start button to start chat which fire long polling. I can see it calling actions while debugging.. And my problem is, When i

JAX-RS and Long Polling

强颜欢笑 提交于 2019-12-07 10:36:16
问题 I'm trying to use long polling with JAX-RS (Jersey implementation) and it doesn't work as I expect. Maybe I'm misunderstanding something. I would appreciate any advice. Please note that using a reverse connection (something like Atmosphere, Comet, etc) is not a option for security reason. Not that I'm currently developing with Tomcat 7. The following method is invoked from a JQuery Ajax call (using $.ajax ). @Path("/poll") @GET public void poll(@Suspended final AsyncResponse asyncResponse)

Long polling in java

邮差的信 提交于 2019-12-06 11:39:29
问题 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

Looking for Comet-Style server or client [closed]

*爱你&永不变心* 提交于 2019-12-06 09:38:12
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I'm looking for a good and simple way to notify my clients about some events in a "push"-way, just like the Comet/Long-Polling server do. The main idea was to set-up a server and create an app with C# which will act as a client. I've found a good thing, Comet server (currently NGINX with http_push module). But