How do you handle clean up when the program receives a kill signal?
For instance, there is an application I connect to that wants any third party app (my app) to se
You can use Runtime.getRuntime().addShutdownHook(...), but you cannot be guaranteed that it will be called in any case.
Runtime.getRuntime().addShutdownHook(...)