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

Re: [ns] TcpApp behaviour




>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.


I have tried it, and I get the same strange behaviour. It seems to work well 
when app1 starts a dialogue with app1. If I put a send something within the 
app-recv proc app1 will get the message. But not the other way round. Also, in 
this case, output from the tracefile (trace-all) is weird, all the packets from 
n2 to n1 are acks, whereas there should be a few "tcp"s to account for the 
reply.

I'm working on a snapshot from a few days. With Felix's patch (posted a few days 
ago also).

>
>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. "

and this is correct from looking at webcache/tcpapp.h and .cc

>
>Thank you,
>-matei
>
>

more to come ...(hopefully)

Tarik