Hello all,

I am trying to connect few tcp sources with sinks using for loop but i am
getting some error. I am attaching below my script of that part and also the
error . Please revert back if you have any idea why its giving the error.
Many thanks.


##########Script########
for { set i 0} {$i < 10} {incr i} {
set tcp($i+24) [new agent/TCP]
$tcp($i+24) set class_ 2
set sink($i+24) [new Agent/TCPSink]
$ns attach-agent $node_(10) $tcp($i+24)
$ns attach-agent $node_($i) $sink($i+24)
$ns connect $tcp($i+24) $sink($i+24)
$tcp($i+24) set fid_ 5
$tcp($i+24) set packetsize_ 100

# Setup ftp over TCP connection
set ftp($i+24) [new Application/FTP]
$ftp($i+24) attach-agent $tcp($i+24)
}
############################
##Error that i got
INITIALIZE THE LIST xListHead
invalid command name "agent/TCP"
    while executing
"agent/TCP create _o542 "
    invoked from within
"catch "$className create $o $args" msg"
    invoked from within
"if [catch "$className create $o $args" msg] {
if [string match "__FAILED_SHADOW_OBJECT_" $msg] {
delete $o
return ""
}
global errorInfo
error "class $..."
    (procedure "new" line 3)
    invoked from within
"new agent/TCP"
    ("for" body line 2)
    invoked from within
"for { set i 0} {$i < 10} {incr i} {
set tcp($i+24) [new agent/TCP]
$tcp($i+24) set class_ 2
set sink($i+24) [new Agent/TCPSink]
$ns attach-agent $node..."
###

Regards,

Vishal Agarwal

Reply via email to