I have a multithreaded listener program whose purpose is to receive ASN.1 messages. If a new socket connection is received I spwan a new thread. Now part of the incoming message is a timeout value. This is where the problem comes in. With this timeout value I need to start a specified "Job". If this "Job" does not complete in the set time, an exception must be thrown so that I can take alternative action. I fiddled with the Timer class but to no avail. Any help would be appreciated. TIA
Robert Ziel
Greenhorn
Joined: Apr 22, 2002
Posts: 28
posted
0
Hi, subscribe to the techtips. this week's tip is about this topic and you will find your answer there. Techtip Timer Robert [ May 22, 2002: Message edited by: Robert Ziel ]
netharam ram
Ranch Hand
Joined: Aug 09, 2001
Posts: 202
posted
0
I too have been fiddling with the same problem ,if u could find any reply that will be helpful for me.And do u know how to make a thread sleep for some seconds for eg.30.I tried using Thread.sleep(1800); but it waits only for 2 seconds what is the actual problem?Waiting for some reply. Happy middling with java. Netharam.
Robert Ziel
Greenhorn
Joined: Apr 22, 2002
Posts: 28
posted
0
Hi, sleep(1800) is 1.8 second sleep(30000) 30 seconds or could be a bit more see the api Robert