G
Guest
Hi All,
I need help with the following: Using VB.NET 2005, I am building a
custom class in a separate assembly. The purpose of this class is to poll
the internet to determine connectivity. I have that part functioning
properly using HTTPRequest and HTTPResponse.
The problem lies here: I'd like to execute this monitoring on an
interval (Ex.: every 5 minutes), to get an up-to-date status. This updated
status would then be propagated to the class/service/app. that instanced my
class, which in my case is a WinForms application, but it can be a Windows
Service, or console app. etc...
I am trying to use the System.Threading.Thread class as from what I have
read, the other 2 types of timers are not really be usable in my situation:
System.Timers.Timer and System.Forms.Timer. I may be wrong on the
System.Timers.Timer, but the System.Forms.Form one, I am sure of this.
What is the best approach to get status data out of my custom class to
the calling app. without cross threading issues (which I am currently
experiencing when I try to transfer info to my WinForms app.). Furthermore,
should I be starting and stopping the timer while I actually perform the
polling, etc...?
Regards,
Giovanni P.
I need help with the following: Using VB.NET 2005, I am building a
custom class in a separate assembly. The purpose of this class is to poll
the internet to determine connectivity. I have that part functioning
properly using HTTPRequest and HTTPResponse.
The problem lies here: I'd like to execute this monitoring on an
interval (Ex.: every 5 minutes), to get an up-to-date status. This updated
status would then be propagated to the class/service/app. that instanced my
class, which in my case is a WinForms application, but it can be a Windows
Service, or console app. etc...
I am trying to use the System.Threading.Thread class as from what I have
read, the other 2 types of timers are not really be usable in my situation:
System.Timers.Timer and System.Forms.Timer. I may be wrong on the
System.Timers.Timer, but the System.Forms.Form one, I am sure of this.
What is the best approach to get status data out of my custom class to
the calling app. without cross threading issues (which I am currently
experiencing when I try to transfer info to my WinForms app.). Furthermore,
should I be starting and stopping the timer while I actually perform the
polling, etc...?
Regards,
Giovanni P.