long-polling

Ajax Long Polling

你。 提交于 2019-11-28 08:47:44
问题 I recently asked a question on StackOverflow about a function of mine and people recommended that I use Ajax Long Polling. I have spent the past couple of days researching the subject and have tried to write basic long polling code, but none of it has worked and I can not get anything I do to work at all. Here is my basic function: <script language='javascript' type='text/javascript'> var interval=self.setInterval("checkformessages()",4000) function checkformessages() { $('#incomingmessages<

WCF suspended call

穿精又带淫゛_ 提交于 2019-11-28 08:47:35
问题 I have a WCF service that implements long-polling. However, I see no way to have each service call spawn a new thread upon being called. As it stands, the long-polled contract is waiting for an event to occur and is blocking any other contracts from being called. What is the recommended way to have one contract run asynchronously from another contract in WCF? I thought of keeping a static thread pool but I'm not quite sure if that solution scales. Thanks! 回答1: In the context of your question,

Implementing long polling in an asynchronous fashion

耗尽温柔 提交于 2019-11-28 07:51:12
Is it possible to take an HTTPServletRequest away from its thread, dissolve this thread (i.e. bring it back to the pool), but keep the underlying connection with the browser working, until I get the results from a time-consuming operation (say, processing an image)? When the return data are processed, another method should be called asynchronously, and be given the request as well as the data as parameters. Usually, long pooling functions in a pretty blocking fashion, where the current thread is not dissolved, which reduces the scalability of the server-side app, in terms of concurrent

Disable ajaxStart() and ajaxStop() for a specific request

China☆狼群 提交于 2019-11-28 03:05:32
I am using .ajaxStart() and .ajaxStop() to show a modal while an ajax request is being made. (between start and stop) Now I'd like to add a longpoll function that keeps waiting for notifications, similar to the one on the left upper corner of this site. My problem now lies in disabling this modal only for the longpolling request.. Registering "loading screen" on and off handlers: $(document).ajaxStart(handleAjaxStart); $(document).ajaxStop(handleAjaxStop); My longpoll function: $.ajax({ timeout: 35000, url: longPollUrl, success: function(data){ if(data.queCount) $('#numQueCount').html(data

Differences between websockets and long polling for turn based game server

独自空忆成欢 提交于 2019-11-28 02:40:52
I am writing a server for an iOS game. The game is turn based and the only time the server needs to push information to the client is to notify of the opponent's move. I am curious if anyone could comment on the performance and ease of implementation differences between using websockets and long polling. Also, if I used websockets, should I only use it to receive information and send POST requests for everything else or should all communication be through the websocket? Additionally, is there anything to extra to consider between websockets and long polling if I am interested in also making a

Is there a real server push over http?

好久不见. 提交于 2019-11-27 19:49:29
I know there are ways to fake it, polling (or long polling) but is there any way to have the server contact the browser to push out information? Either polling option wastes resources on the server and depending on the server can lock it up (apache and iis for example). Seems like a lot of sites are using long polling to fake a server-side push mechanism over http. Wouldn't it just be better to have a true push protocol built into a browser? What options are there that are server friendly to push (fake or otherwise) information to web browsers? I know there are ways to fake it, polling (or

How to do long-polling AJAX requests in ASP.NET MVC? [duplicate]

走远了吗. 提交于 2019-11-27 17:38:05
This question already has an answer here: Comet implementation for ASP.NET? [closed] 8 answers Does anyone know how to code up long-polling AJAX requests (for server PUSH notifications) in ASP.NET MVC? Whenever I do it, it seems that only the last browser to open up a window gets the notifications. As if IIS/ASP.NET were canceling the last request because it was hung or something. Jacob I recently wrote a simple example of a Long Polling Chat Server using MVC 3 Async Controllers based on a great article by Clay Lenhart You can use the example on a AppHarbor deployment I set up based on the

How does a WCF server inform a WCF client about changes? (Better solution then simple polling, e.g. Comet or long polling)

Deadly 提交于 2019-11-27 17:08:17
see also " WCF push to client through firewall " I need to have a WCF client that connect to a WCF server, then when some of the data changes on the server the clients need to update its display. As there is likely to be a firewall between the clients and the server. All communications must be over HTTP The server can not make an (physical) outgoing call to the client. As I am writing both the client and the server I do not need to limit the solution to only using soap etc. I am looking for built in surport for " long polling " / " Comet " etc Thanks for the most informative answer from Drew

Recommendation for integrating nodejs with php application

£可爱£侵袭症+ 提交于 2019-11-27 16:44:48
问题 I have an existing app written in PHP (using Kohana framework) and I want to do long polling. From some things I read it seems that doing long polling with PHP is not advisable and using something like nodejs is a better choice. My question is what's the best way to integrate nodejs (or some other well suited tool for long polling) with an existing application? For clarification my app basically is a browser plugin that you can use to send data to groups of other people. When that data is

Long Polling with Spring's DeferredResult

非 Y 不嫁゛ 提交于 2019-11-27 16:17:22
问题 The client periodically calls an async method (long polling), passing it a value of a stock symbol, which the server uses to query the database and return the object back to the client. I am using Spring's DeferredResult class, however I'm not familiar with how it works. Notice how I am using the symbol property (sent from client) to query the database for new data (see below). Perhaps there is a better approach for long polling with Spring? How do I pass the symbol property from the method