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

[ns] TcpApp behaviour



Hi,

I am trying to use TcpApp and I face this strange behavior:

- everything  works fine when I send data from the application that
calls 'connect' to the other.

  $tcp2 listen
  set app1 [new Application/TcpApp $tcp1]
  set app2 [new Application/TcpApp $tcp2]
  $app1 connect $app2

  $ns at 1.2 "$app1 send 100 \"$app2 app-recv 100\""           (*)


-but when I try to send data first from the "listener" to the other part
nothing happens.  I am doing this replacing line (*) with:

  $ns at 1.2 "$app2 send 100 \"$app1 app-recv 100\""

- it is even stranger that this transfer succeds when code looks like:

   $ns at 0.6 "$app1 send 100 \"$app2 app-recv 100\""
   $ns at 1.2 "$app2 send 100 \"$app1 app-recv 100\""


Probably I am missing something ....
Tcl script attached if this helps.

Manual says:  " connect: Connecting another TcpApp to this one. This
connection is bi-directional, i.e., only one call to connect is needed,
and data can be sent in either direction. "

Thank you,
-matei


xx.tcl