D
Douglas Gallant
I have a FileSystemWatcher monitoring a UNC path in a Windows service
routine. If network connectivity is disrupted for some reason (including the
remote server being restarted), the application stops receiving FSW events.
How can I determine if I have lost connectivity and force a restart of the
service (or whatever makes sense)? I'm hoping there is some event I can hook
into but that may be optimistic. I suppose setting up a Timer and trying
some type of access to the UNC path on the timer event would work but just
seems a tad crude.
Also, how do I force a service to restart? Do I have to throw an exception
and have the service configured to auto-restart after some interval or can
this be done cleanly within the service?
Thanks,
Douglas Gallant
routine. If network connectivity is disrupted for some reason (including the
remote server being restarted), the application stops receiving FSW events.
How can I determine if I have lost connectivity and force a restart of the
service (or whatever makes sense)? I'm hoping there is some event I can hook
into but that may be optimistic. I suppose setting up a Timer and trying
some type of access to the UNC path on the timer event would work but just
seems a tad crude.
Also, how do I force a service to restart? Do I have to throw an exception
and have the service configured to auto-restart after some interval or can
this be done cleanly within the service?
Thanks,
Douglas Gallant