[ns] can't get proc {} done to work
Lars Eggert
lars.eggert at nokia.com
Fri Feb 2 00:39:28 PST 2007
Hi,
after a few years of little ns use, I've recently started to use it
more actively again. I remember being able to attach a proc {} done
method to TCP Agents that fired when the connection closes, but
either I'm remembering incorrectly how to do it, or stuff has changed
since then.
Here's a snippet:
set sender [new Agent/TCP/Sack1]
set receiver [new Agent/TCPSink/Sack1]
$ns attach-agent $src $sender
$ns attach-agent $sink $receiver
$ns connect $sender $receiver
set ftp [new Application/FTP]
$ftp attach-agent $sender
$ns at 0 "$ftp produce 10"
$sender proc {} done { puts "done"; }
I'd expect this to print "done" at some point, but it doesn't. Can
anyone clue me in?
Thanks,
Lars
More information about the Ns-users
mailing list