John:
What do you mean by "timed wait on an object"?
I meant to call
wait(long) method.
This method will force the current thread to wait till there is a notify on the monitor or the timeout value has passed. So, your server will wait for a maximum of n milliseconds or an ack from the client.
In contrast to a sleep, a wait can be terminated by a notify.
A sleeping thread can only wake up when the sleeping period is over or it is interrupted.(ignoring the spurious wakeups.)
On the other hand a waiting thread can be woken by a notify (in your case, the thread listening for the ACK will notify the server)
John:
I created a thread whose sole responsibility is to wait for ACK and wake up the sleeping server when that ACK arrives. But I am still ignorant on how to awaken the sleeping server. I went over the Thread API but there aren't any methods that I can use like threadName.awaken() or Thread.awaken(threadName) something similar.
No there is no such method as awaken(). As explained above,
you should use a wait/notify mechanism.
This article wil give you some insight into wait/notify.
P.S.: If you are on jdk 5 or above, you may be interested in using
Conditions instead of wait/notify.