I am writing an application that provides reliable network transport over a deliberately unreliable socket (it is a university assignment). At this stage it is just a stop-and-wait protocol. I want to have two events that can trigger a resend:
* timeout event * incorrectly numbered ack received
My question is, how do I start a timer and have either Unreliabe.receive() or a timeout event trigger a resend? Two events that cause one action.
My next problem should probably be in the begginner forum, but I'll keep it in this thread as it's directly related to it.
The send() method below is an overriding method, which adds TCP-like reliability to a UDP socket. After the headers have been added, I need to call super.send() to pass the reliable packet to the unreliable socket.
My question is, how do I call super.send() from within the TimerTask, which is obviously a subclass?