request-cancelling

how to cancel WCF service call?

旧时模样 提交于 2019-12-02 05:20:49
I have a WCF function that is executing long time, so I call the function in UI with backgraundworker... I want to give a feature to cancel the execution, so I abort IComunicationObject, the problem is that Service execution is not stoping, Is there any way to stop Service execution in this case? You may not need a BackgroundWorker. You can either make the operation IsOneWay, or implement the asynchronous pattern . To prevent threading issues, consider using the SynchronizationContext . Programming WCF Services does a great job at explaining these. Make a CancelOperation() method which sets

How to cancel ajax request that has run (on server side)

假装没事ソ 提交于 2019-12-01 14:02:57
问题 I was wondering if there's a simple way to cancel an AJAX request? Beyond just calling an 'abort' on the XMLHTTPRequest on the client side, is there a way to easily stop the server process? The server is using Apache. Thanks 回答1: No. There's definitely no simple way. I can think of some complex ways, but they would be unreliable. You'll probably have more luck developing a process for reversing the changes from a request you've just run (I'm assuming that's the reason you would want to stop

Handling cancelled request with Express/Node.js and Angular

半世苍凉 提交于 2019-11-30 06:26:18
When a pending HTTP request is cancelled by a client/browser it seems that Node with Express continues to process the request. For intensive requests, the CPU is still being kept busy with unnecessary requests. Is there a way to ask Node.js/Express to kill/stop these pending requests that are requested to be cancelled? It becomes particularly useful given that since AngularJS 1.5 HTTP request are easily cancellable by calling $cancelRequest() on $http / $resource objects. Such cancellations could occur when exposing an API method providing results for auto-completion or search fields: when

jQuery - Cancel form submit (using “return false”?)?

我怕爱的太早我们不能终老 提交于 2019-11-29 09:55:17
I'm running into a bit of trouble while trying to cancel the submit of a form. I've been following this tutorial (even though i'm not making a login script), and it seems to be working for him. Here's my form: <form action="index.php" method="post" name="pForm"> <textarea name="comment" onclick="if(this.value == 'skriv här...') this.value='';" onblur="if(this.value.length == 0) this.value='skriv här...';">skriv här...</textarea> <input class="submit" type="submit" value="Publicera!" name="submit" /> </form> And here's the jquery: $(document).ready(function() { $('form[name=pForm]').submit

jQuery - Cancel form submit (using “return false”?)?

倾然丶 夕夏残阳落幕 提交于 2019-11-28 03:18:34
问题 I'm running into a bit of trouble while trying to cancel the submit of a form. I've been following this tutorial (even though i'm not making a login script), and it seems to be working for him. Here's my form: <form action="index.php" method="post" name="pForm"> <textarea name="comment" onclick="if(this.value == 'skriv här...') this.value='';" onblur="if(this.value.length == 0) this.value='skriv här...';">skriv här...</textarea> <input class="submit" type="submit" value="Publicera!" name=

Can a http server detect that a client has cancelled their request?

一个人想着一个人 提交于 2019-11-27 21:07:59
My web app must process and serve a lot of data to display certain pages. Sometimes, the user closes or refreshes a page while the server is still busy processing it. This means the server will continue to process data for several minutes only to send it to a client who is no longer listening. Is it possible to detect that the connection has been broken, and react to it? In this particular project, we're using Django and NginX, or Apache. I assumed this is possible because the Django development server appears to react to cancelled requests by printing Broken Pipe exceptions. I'd love to have