Hi,
When I run WebRequest or HttpWebRequest to check for a response from my server, all works fine.
To initiate the default timeout built into WebRequest, I disabled the internet connection in my router. During the attempt for a request the UI freezes, which I know is normal.
So, I'm puzzled as to whether I use an Asynchronous HttpWebRequest, or simply initiate the WebRequest in a background thread.
My understanding is that it is basically the same thing, is this wrong!
My requirements;
When I click a button, it does various procedures to check for an internet connection. Upon getting a result it displays this in a textbox on the UI.
So if I run a WebRequest in the background, I don't want the UI to freeze and I want a callback from the background thread or Async API to update the textbox with the results.
My question;
What is the difference between using an Asynchronous HttpWebRequest and running a WebRequest in a background thread?
Which should I use?
Thanks
Danny
When I run WebRequest or HttpWebRequest to check for a response from my server, all works fine.
To initiate the default timeout built into WebRequest, I disabled the internet connection in my router. During the attempt for a request the UI freezes, which I know is normal.
So, I'm puzzled as to whether I use an Asynchronous HttpWebRequest, or simply initiate the WebRequest in a background thread.
My understanding is that it is basically the same thing, is this wrong!
My requirements;
When I click a button, it does various procedures to check for an internet connection. Upon getting a result it displays this in a textbox on the UI.
So if I run a WebRequest in the background, I don't want the UI to freeze and I want a callback from the background thread or Async API to update the textbox with the results.
My question;
What is the difference between using an Asynchronous HttpWebRequest and running a WebRequest in a background thread?
Which should I use?
Thanks
Danny