[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TCP agent deletion



On Thu, 24 Feb 2000, Felix Hernandez Campos wrote:

> I'm trying to learn how to delete an agent and I just cannot get it to work.
> I'm redefining the done method, as I have seen in some examples, but I always
> get a segmentation fault. My new done method is
> 
> $tcp0 proc done {} {
>     global ns tcp0 n0
>     puts [concat "TCP agent done at " [$ns now] ]
>     $ns detach-agent $n0 $tcp0
>     delete $tcp0
> }

Replace $tcp0 proc done {} {
with just
proc done {} {

so that your script deletes the agent outside the context of the
agent.

L.

<L.Wood@surrey.ac.uk>PGP<http://www.ee.surrey.ac.uk/Personal/L.Wood/>