Anton Osennikov wrote:
>
<snip>
>
> 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 }
or
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.
Thanks!
Matthew
> }
> }
>
> 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 http://www.cisco.com/ mlevine@cisco.com (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 <tkined-request@ibr.cs.tu-bs.de>. !! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.
This archive was generated by hypermail 2b29 : Mon Jan 08 2001 - 15:27:46 MET