On 22-May-2000 Martin van Velsen wrote:
> I wrote a TCP/IP based application for the PalmPilot which I have
> to demonstrate quite often. During one of those demos I don't always
> have the time to babysit the device. It seems that when the PalmPilot
> shuts off after the maximum of 3 minutes, the low-level network stack
> dies. However it seems that the higher level Netlib library is still
> loaded and thinks it's still connected. Is there a way to prevent the
> device from turning off ?
I went through that before. I suggest that you check for power down in order
to close down the network. Also I think that it is possible for the network
to still be alive even though the interface is dead, and that is why there is
a NetLibConnectionRefresh() function.
What I do is test for conditions which I want to hang up on:
/*
* If one of the silk screened keys is hit we want
* to shutdown the connection.
*/
if ((e.eType == keyDownEvent) &&
(e.data.keyDown.modifiers & commandKeyMask) &&
((e.data.keyDown.chr == launchChr) ||
(e.data.keyDown.chr == autoOffChr) ||
(e.data.keyDown.chr == hardPowerChr))) {
CloseMyConnections();
}
I test for launchChr specifically because on PalmOS2 the launcher is a popup
and does not terminate the application, yet I still want to close my
connections. Whenever any other app is launched your app will be shut down
normally so you don't have to test for any other buttons.
/* Chris Faherty <[EMAIL PROTECTED]> */
/* Your Stock has crashed - you must now restart your system */
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/