Technical Q&ANW 45 - Putting Client/Server Systems to Sleep (9-Jan-97)Q I am writing a fax client/server system and I have encountered a problem after I put the server to sleep: on waking, the server software does not seem to re-register on the network (using RegisterMyName ).
On the client side, (when receiving a A In general, you might want to disable sleep on your server by informing the Power Manager with AutoSleepControl(false) .
Otherwise, the clients might
never know that your server is sleeping, and will be unable to connect.
But if you do want to support sleep, then a server should install
a sleep procedure through the Power Manager using
SleepQInstall .
The exact interaction of how your server should handle
sleepDemand if the user selects Sleep from the Special menu. The
AutoSleepControl(false) call will stop sleepRequests
but will it also stop SleepDemands ?A Your Application can (should) not refuse a sleepDemand , as documented in
Inside Macintosh: Devices pg 6-11:When your sleep procedure receives a sleep demand, however, your procedure has no way to determine whether it originated as a conditional sleep demand or an unconditional sleep demand. Your device driver or application must prepare for the sleep state and return control promptly to the Power Manager when it receives a sleep demand. As for When enableSleep is set to false, the computer will not go into the sleep mode unless it is forced to either by some user action --for example, by the user's selecting Sleep from the Special menu of the Finder --or in a low battery situation. --Vinnie Moscaritolo Worldwide Developer Technical Support Technical Q&A Previous Question | Contents | Next Question To contact us, please use the Contact Us page. |