Well, there may be some way to check the state with the Win32 API or WMI, but the timing would probably be tricky. Checking the time, as suggested by Glenn, might work, but strikes me as possibly unreliable, since hibernation can be triggered by a variable timer and user commands. Unless I totally missed his thought process there.
Why not just provide an automated re-connect for the app? If the socket connection fails have it attempt to re-connect, up to x number of times, then maybe give a warning with a manual re-connect button. Or something to that effect. I don't think it's realistic to assume an application will have a perfect network experience, and a re-connect save you headaches from unforeseen outages. Good luck, Fargo Jim Dossey wrote: > I have an app for Windows that opens a socket to a server and receives > various updates from the server. To run it, I simply put a shortcut to the > app in the Startup folder in the Start menu. But I found out that some > users don't shutdown their PC's. Instead they use Hibernate. The problem > is that the socket gets closed on the server end, so that when the machine > is started up again, the app is still running, but the socket is no longer > working. Is there some way to tell either when a machine is going into or > out of hibernate mode? > > Thanks, > Jim > Win XP, RB 2007R2 > _______________________________________________ > > _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html>
