How do I interrupt the HttpWebRequest (from another thread)?
1 answer
I believe it will save you some effort to put everything in one try / trick. Also take a look at this: Is it possible to interrupt a task, for example interrupt the Thread (Thread.Abort) method?
public void Abort()
{
if (request != null)
{
try
{
request.ReadWriteTimeout = 0; } catch { }
request.Timeout = 0;
request.Abort();
} catch {//Some error}
}
}
0
source to share