long-polling

How to do a long polling client in C#?

不想你离开。 提交于 2019-11-30 23:30:33
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 You should be able to configure the timeout on the web service object - the details will depend on exactly which class it's using, but look at WebClientProtocol

Long Polling in Angular 4

一世执手 提交于 2019-11-30 20:26:54
I need to do API calls to display the progress of something. I have created a service which does this every 1.5 seconds Main Component private getProgress() { this.progressService.getExportProgress(this.type, this.details.RequestID); } Services.ts public getExportProgress(type: string, requestId: string) { Observable.interval(1500) .switchMap(() => this.http.get(this.apiEndpoint + "Definition/" + type + "/Progress/" + requestId)) .map((data) => data.json().Data) .subscribe( (data) => { if (!data.InProgress) //Stop doing this api call }, error => this.handleError(error)); } The call works, but

jsonp comet hanging request causes ugly “loading” status on browsers

亡梦爱人 提交于 2019-11-30 16:36:23
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 this time, browsers see my request as a "loading" state. I am using this: http://code.google.com/p/jquery-jsonp/ Thanks in advance! As far as I know, there is no way to suppress the loading status using Javascript, regardless of why you have it. However, there is

Long-polling vs websocket when expecting one-time response from server-side

淺唱寂寞╮ 提交于 2019-11-30 15:27:57
I have read many articles on real-time push notifications. And the resume is that websocket is generally the preferred technique as long as you are not concerned about 100% browser compatibility. And yet, one article states that Long polling - potentially when you are exchanging single call with server, and server is doing some work in background. This is exactly my case. The user presses a button which initiates some complex calculations on server-side, and as soon as the answer is ready, the server sends a push-notification to the client. The question is, can we say that for the case of one

Long Polling with PHP on Apache

南笙酒味 提交于 2019-11-30 13:42:56
Hopefully I can explain this well enough. I am working on creating a PHP library to handle ajax requests through PHP in an object oriented manner. I am currently pondering a good way to implement a long polling solution but am curious about something. Apache doesn't handle keeping multiple connections open very well. The thread-per-request model makes Apache highly inefficient for long polling. Using server's such as nginx and lighttpd handle these threads much better so in the library, I plan on implementing different functions optimized to the specific servers available from a single

Long Polling using jQuery and PHP

有些话、适合烂在心里 提交于 2019-11-30 10:48:00
So, I've been trying to do Long-Polling using the jQuery Library and PHP. I'm doing this so I can make some sort of real-time notifications system in the future. The code I have now isn't really working. index.php <html> <head> <title>Long Polling</title> <script type='text/javascript' src='http://code.jquery.com/jquery-1.6.2.min.js'></script> <script type='text/javascript'> $(document).ready(function() { getData(); }); function getData() { $.ajax({ type: "POST", url: "ajax.php", async: true, timeout: 50000, data: "get=true", success: function(data) { $("#info").append(data); setTimeout(

Is long polling possible in Google App Engine?

五迷三道 提交于 2019-11-30 09:18:19
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? sahid Google AppEngine has a new feature Channel API, with that you have a possibility to build a good realtime application . Another solution is to use a third part comet server like mochiweb or twisted with a iframe pattern. Client1, waiting a event: client1 --Iframe Pattern--> Erlang/Mochiweb(HttpLongPolling): Client2, sending a message: client2 -

Nginx + PHP: stop process at canceled request

╄→гoц情女王★ 提交于 2019-11-30 08:37:58
I have Nginx 1.4.4 and PHP 5.5.6. I'm making long-polling requests. Problem is, that if I cancel the HTTP request sent via Ajax, requests are still processing (they don't stop). I tested it with the PHP mail() function at end of file, and mail is still coming the file didn't stop). I'm worried, because I think that it might cause server crash because of the high load of unclosed requests. Yes, I tried ignore_user_abort(false); but with no changes. Is possible that I should change something in Nginx? location ~ \.php$ { try_files $uri =404; include fastcgi_params; fastcgi_pass 127.0.0.1:9000;

Why should session_write_close be used in long polling?

烂漫一生 提交于 2019-11-30 07:30:53
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 and returned the result? Why should this happen? And how can session_write_close help here? Won't using

How to determine server disconnection from SignalR client?

心已入冬 提交于 2019-11-30 06:02:55
The question is how can SignalR JavaScript client detect when connection with server is lost? Thanks for any reply! John Rayner A hub has a method disconnect which will allow you to add a callback when disconnection takes place: myHub.disconnect(function() { alert('Server has disconnected'); }); If you aren't using hubs then the code for the disconnect method will help you out: $(connection).bind("onDisconnect", function (e, data) { callback.call(connection); }); This shows the syntax for hooking onto the onDisconnect event of the underlying connection. If you are using hubs then implement the