grahamr (work)
June 7th, 2007, 05:30 AM
I am writing a program that handles data connections across a wireless connection. The environment is quite noisy so I need to handle disconnections.
The current method is that a user clicks a "job" button which causes a modal dialog to open. This dialog connects to the remote host and tries to download a new task. When the new task is downloaded the dialog closes and the user can now do other stuff related to the job.
When an 'unclean' disconnection happens (not terminated by the correct disconnect code) the program fires an exception. However the exception is triggered in another thread which propagates down to the run() function. From here the code disappears back into the kernal. The main program (the dialog) doesn't know there is a disconnection.
I was wondering if anyone else has done similar and what strategies I could employ that the main application can handle temporary and permanent outages?
Thanks, Graham Reeds
The current method is that a user clicks a "job" button which causes a modal dialog to open. This dialog connects to the remote host and tries to download a new task. When the new task is downloaded the dialog closes and the user can now do other stuff related to the job.
When an 'unclean' disconnection happens (not terminated by the correct disconnect code) the program fires an exception. However the exception is triggered in another thread which propagates down to the run() function. From here the code disappears back into the kernal. The main program (the dialog) doesn't know there is a disconnection.
I was wondering if anyone else has done similar and what strategies I could employ that the main application can handle temporary and permanent outages?
Thanks, Graham Reeds