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

From: Matthew Levine (
Date: Fri Jun 16 2000 - 17:05:42 MET DST

Anton Osennikov wrote:
> proc resendPacket {packetNo} {
> global packets
> if {[info exists packets($packetNo)]} {
> sendPacket $packetNo

>> after $timeout resendPacket $packetNo <<

This is the missing piece. I already have routines to track the packets
and the acks. I just had a syntactical error.

See I had something like:

        after $timeout { resendPacket $packetNo }

        after $timeout "resendPacket $packetNo"

which both do the same thing. They delay the evaluation of $packetNo
into the after scope (global) for which packetNo does not exist.

However, as you have written it, $packetNo is evaluated before the after
command is evaluated. Thus, the value of packetNo, and not the
reference to it, is included as part of the callback.

Geesh! It was a simple answer. I guess I need to review some of the
basic Tcl rules.


> }
> }
> proc receiveAck {packet} {
> global packets
> set packetNo [whatPacket $packet]
> unset packets $packetNo
> }
> --
> Best wishes, Anton Osennikov.

Matthew Levine
Development Test (Consumer Line Of Business)
Cisco Systems, Inc	(408) 525 - 5431
!! 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