Application being put to sleep, why? 
Author Message
 Application being put to sleep, why?

I've got a problem that I am banging my head trying to figure out. I
have a file transfer application that uses a TCP/IP connection through
the WinInet library, FTP to be exact. The app starts doing transfers
in an independent thread from the main thread. The main thread
monitors the transfer thread for each file as it gets completed. In
the main execution loop I have embedded the SetThreadExecutionState
call with the ES_SYSTEM and continuous flags, as well as having it in
the worker thread's inner loop for block transfers. However, after an
hour of transferring a single file in which there is not real work
being done by the main process, the app gets put to "sleep" for an
hour period. I know this because of detailed logging to a file in
which gaps of 1 hour occur exactly 1 hour after having started. Now,
if the user is doing stuff at the computer this does not happen.

I thought the SetThreadExecutionState API call was supposed to take
care of this crazy thing and not allow the OS to put apps to sleep. Am
I missing something? Is my having the call in the main process and
inner loop of the transfer function an "overuse" case that negates the
use at all? What gives? I am at a complete loss?

Please email me directly as well as posting back here, please.

Sun, 03 Apr 2005 16:54:48 GMT  
 [ 1 post ] 

 Relevant Pages 

1. How to put an app to sleep?

2. Putting the program to sleep

3. Using Sleeps() in my Winsock application

4. interrupt sleep() or successive sleeps

5. Why am I getting an ExecutionEngineException?

6. Why am I being ignored ???

7. Why am I seeing such a delay between my catch block and my finally block

8. Macro with functions problem -- why am I stupid?

9. Why am I not getting correct position?

10. Why am I getting a segmentation fault?

11. Why am I not intercepting Enter key (VK_RETURN)

12. Why am I getting a General protection Fault?


Powered by phpBB® Forum Software