What does the WebClientAsyncResult.Abort method actually do under the covers?
I have a windows service that is sending asynchronous requests to a web
service and then storing the IAsyncResult object in a hashtable with a
meaningful key. The web service will do some processing and then send an
email notification to a specified recipient and call a callback method so
that the IAsyncResult is removed from the hashtable. If the windows service
shuts down, I want to loop through each of my saved IAsyncResults, cast it to
a WebClientAsyncResult, and call Abort. What I am finding, though, is that
when I call Abort from within the windows service, I get my web service
response right away (a la System.Net.WebException "The underlying connection
was closed...etc.), but the processing continues on the server to the
completion of the method. At times, even several minutes after I have called
the Abort method, I find that the server thread is not aborted and the emails
are still sending. What I want to happen is for the server thread to halt as
well as the client. Is there anything I can implement on the server side
that will check to see if the client async call was aborted midway through
the method?
Please advise.
Thanks,
TheManFromSql 2 1395
You could try Response.IsClientConnected. Please let use know if it works
(never tried this, it may expose a result that is found during the lest
response.write, it could be also possible that buffering needs to be turned
off).
--
Patrice
"The Man From SQL" <th***********@community.nospam> a écrit dans le message
de news: 1E**********************************@microsoft.com... What does the WebClientAsyncResult.Abort method actually do under the covers?
I have a windows service that is sending asynchronous requests to a web service and then storing the IAsyncResult object in a hashtable with a meaningful key. The web service will do some processing and then send an email notification to a specified recipient and call a callback method so that the IAsyncResult is removed from the hashtable. If the windows service shuts down, I want to loop through each of my saved IAsyncResults, cast it to a WebClientAsyncResult, and call Abort. What I am finding, though, is that when I call Abort from within the windows service, I get my web service response right away (a la System.Net.WebException "The underlying connection was closed...etc.), but the processing continues on the server to the completion of the method. At times, even several minutes after I have called the Abort method, I find that the server thread is not aborted and the emails are still sending. What I want to happen is for the server thread to halt as well as the client. Is there anything I can implement on the server side that will check to see if the client async call was aborted midway through the method?
Please advise.
Thanks,
TheManFromSql
Patrice,
That worked like a charm. If you ever get to Cedar Rapids, Iowa, I owe you
homemade ice cream.
Thanks,
TheManFromSQL
"Patrice" wrote: You could try Response.IsClientConnected. Please let use know if it works
(never tried this, it may expose a result that is found during the lest response.write, it could be also possible that buffering needs to be turned off).
-- Patrice
"The Man From SQL" <th***********@community.nospam> a écrit dans le message de news: 1E**********************************@microsoft.com... What does the WebClientAsyncResult.Abort method actually do under the covers?
I have a windows service that is sending asynchronous requests to a web service and then storing the IAsyncResult object in a hashtable with a meaningful key. The web service will do some processing and then send an email notification to a specified recipient and call a callback method so that the IAsyncResult is removed from the hashtable. If the windows service shuts down, I want to loop through each of my saved IAsyncResults, cast it to a WebClientAsyncResult, and call Abort. What I am finding, though, is that when I call Abort from within the windows service, I get my web service response right away (a la System.Net.WebException "The underlying connection was closed...etc.), but the processing continues on the server to the completion of the method. At times, even several minutes after I have called the Abort method, I find that the server thread is not aborted and the emails are still sending. What I want to happen is for the server thread to halt as well as the client. Is there anything I can implement on the server side that will check to see if the client async call was aborted midway through the method?
Please advise.
Thanks,
TheManFromSql This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Michael Rybak |
last post by:
hi, everyone.
I'm writing a 2-players game that should support network mode. I'm now
testing it on 1 PC since I don't have 2. I directly use sockets, and
both client and server do...
|
by: Harley |
last post by:
Hello,
I am just learning the tcp/ip functions etc under vb.net so please
look over me if this is obviouse. I have been all over looking into
any functions that I didn't totaly understand and...
|
by: Ankit Aneja |
last post by:
i am doing here some some socket-client work in C# windows service
it is working fine for multiple clients
now i want to limit these multiple clients to 25 for example
i want that when service...
|
by: Delmar |
last post by:
I need to build Web Application that will generate a client to execute some
operations.
Each client has running silent application.
Maybe somebody can advice me what can I do ?
Thank you.
|
by: Ankit Aneja |
last post by:
The code of classes given below is for server to which clients connect
i want to get ip address of client which has connected
pls help how can i get
//listen class
public class listen
{
|
by: J Huntley Palmer |
last post by:
I am having a horrific time integrating uw-imap's c-client for imap
support in php. The problem is a whole bunch of "Text relocation remains
referenced against symbol" errors during
linking....
|
by: khu84 |
last post by:
Here is client server very simple code, seems to work with telnet but with with web client code gives blank output.
Following is the server code:-
<?php
function...
|
by: nsaffary |
last post by:
hi
I hava a client/server program that run correctly when i run it in one computer(local) but when I run client on a one computer and run server run on another, connection does not stablish.(I set...
|
by: MMcCarthy |
last post by:
http://bytes.com/images/howtos/projectscope_blocks.jpgAs a freelance IT consultant for over 10 years, I’ve come to appreciate well defined project scopes. A project scope is a common understanding...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |