Re: [tkined] udp, tcl, and retry code help?

From: Mark Harrison (
Date: Fri Jun 16 2000 - 07:19:41 MET DST

Matthew Levine <>
> Yes, but how do you handle retries? Sending and receiving is not an
> issue. I even know where its going or came from. The tricky part is
> once its left, how do I kick off a timer for the acknowledgement? And
> when that timer fires,

Try something like this:

    Keep an array of "attempted packets"
    Each time you send a packet, put it in the "attempted packets" array
    When you receive a positive response from the other side, remove the
    acknowledged packet from the "attempted packets" array.

> how will I know which timer fired since I may
> have quite a few timers active at once?

Two possible ideas:

    Add a packet parameter to your retry routine:
        after $timeout "retry $x"

    Keep "time last sent" as a data member of your "attempted packets"
    array. When the periodic timeout occurs, cycle through the array
    resending all expired packets.

You might look at the Andrew Tannenbaum networking book, it has a
really good explanation of these techniques... Look in the index
under "sliding windows protocol".


Mark Harrison                          AsiaInfo Holding, Inc.                Beijing/Santa Clara

-- !! This message is brought to you via the `tkined & scotty' mailing list. !! Please do not reply to this message to unsubscribe. To subscribe or !! unsubscribe, send a mail message to <>. !! See for more information.

This archive was generated by hypermail 2b29 : Mon Jan 08 2001 - 15:27:46 MET