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

Re: [ns] too many arguments



Any arguments passed that have spaces maybe mistaken as 2 arguments.  It
is best to put {} around your tcl arguments so that tcl will know for
sure to treat a string with a space as one argument.

Try using this:
tcl.evalf("[{%s} set node_] leave-group {%s} {%d}",agent_->name(),
agent_->name(),groupaddr);

and see if it fixes the problem.

- John Mehringer


Sencun Zhu wrote:
> 
> Dear all:
> 
>         I met an error as follows when I ran in C++ level:
> tcl.evalf("[%s set node_] leave-group %s %d",agent_->name(),agent_->name(),groupaddr);
> 
> but this only go wrong occasionnally. while in my program, there might be
> multiple agents attached to one node and taken participate in the same
> multicast group, will this affect?
> 
> any hint?
> 
> thank you .
> 
> Sencun
> 
> ----------------------------
> ns: [_o32467 set node_] leave-group _o32467 -2147483648: called
> "_o28711" with too many arguments
>     (CtrMcast leave-group line 1)
>     invoked from within
> "_o28711 leave-group -2147483648 "
>     ("eval" body line 1)
>     invoked from within
> "eval $p $op $args"
>     (procedure "_o3199" line 7)
>     (mrtObject all-mprotos line 7)
>     invoked from within
> "_o3199 all-mprotos leave-group -2147483648 "
>     ("eval" body line 1)
>     invoked from within
> "eval $self all-mprotos leave-group $grp $src"
>     (procedure "_o3199" line 2)
>     (mrtObject leave-group line 2)
>     invoked from within
> "$mrtObject_ leave-group $group $src"
>     (procedure "_o3193" line 16)
>     (Node leave-group line 16)
>     invoked from within
> "[_o32467 set node_] leave-group _o32467 -2147483648"
> 
> --------------------------------