[maemo-developers] [maemo-developers] How to keep app running indefinitely

From: Kalle Valo Kalle.Valo at nokia.com
Date: Thu Mar 9 12:01:35 EET 2006
"Steven Hill" <steveh at shscientific.com> writes:

> I tried this method, and it did not work.  If the internet connection is
> dropped due to inactivity, the app also stops.

Like Kimmo said, there shouldn't be anything killing you application.
This smells like a bug. Let's try find it, but to do that you have to
provide some more information. Can you get any output from your
application. Does it crash or what? Are there any errors and if yes,
what? Do you use libosso-ic-preload.so library with LD_PRELOAD,
osso_socket() or IC API?

Please note that with the first two methods (libosso-ic-preload.so and
osso_socket() all sockets are closed with shutdown(2) if the Internet
connection is dropped. Does your application handle this gracefully?
This is the first thing I would check.

(With IC API this doesn't happen, with that method it's the
applications responsibility to close the sockets.)

> I came up with a workaround that pings a socket every 30
> seconds - that keeps the app running with screen dimming and blanking
> still functional.  But what do I do if my socket crashes or I lose my
> internet connection due to a wireless router malfunction or
> whatever??

I agree, that's just a hack and nowhere near a proper solution.
Applications shouldn't die when connections drop. With mobile devices
connections drop all the time and we need to handle it properly.

BTW, are you aware of that you disable connection idle timer from the
Connectivity Control Panel applet?

> There must be a method that will intercept the system call to shut the
> app off and ignore it, but I have not found such a thing discussed in
> the maemo docs.

You assume that this is a desired functionality, but it's not. There's
a bug somewhere, that just needs to be found. We don't kill
applications just for fun :)

-- 
Kalle Valo


More information about the maemo-developers mailing list