Hi,
nc.util.Timer sounds appropriate for the timeout.
I suggest you start a "timeout thread" as soon as you start waiting (after you sent a packet, I guess), something like this:
Then, you start waiting for the ACK. When it arrives, just set
canceled to true and the
thread you started will quietly do nothing when it will run().
Note: (make sure you have exactly one
canceled variable per Thread you start and not a unique global one => maybe encapsulating it in the TimerTask or something)