I have a service that goes out and crawls the web. Apparently some pages are
prompting for user input, which obviously you can't do with a service, so
that the thread stops.
I'm using HttpWebResponse with a timeout of 30 seconds and keepalive =
false.
I already am checking for the timeout and that seems to work when the page
just doesn't load. But there are some pages that it seems to get stuck on
and I don't know why.
My thought is that if it takes to long to get the pages, I'll just abort it.
Any thoughts?
TIA - Jeff.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in
message news:7E**********************************@microsof t.com...
Are you performing any interop on the thread? If the call stack is
waiting on an interop call, then the thread can not abort until the
unmanaged code completes.
I would concentrate more on finding out why the thread hangs, as
aborting is not really the optimal way to signal that a thread should
finish its work.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Mufasa" <jb@nowhere.comwrote in message
news:e2**************@TK2MSFTNGP05.phx.gbl...
>Is there any way to force a thread to abort and really have it abort? I
have a thread that every once in a while gets hung to so I kill it.
Problem is I have a thread that every once in a while gets stuck (I'm
working on why that happens) and I want to kill it. I do a thread.abort
and the status becomes abortrequested but never actually goes through.
If it were an actual process I could kill it but there seems to be no
real kill for thread other than abort.
Any thoughts?
TIA - Jeff.