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

Re: [ns] communication between agents.



One simple way to do this is to pass pointers to each other by addind a
command the command method. Then once you have pointers to the other
object you can do wahtever you want ..... 

if you dont have experience in C++, then it may not be easy :) you must
read the manual on tcl linkage. and know how to pass pointers etc. 

Debo

On Tue, 1 May 2001, Alexander Rasin wrote:

> 
> Hi,
> 
> I am trying to find out how to pass a message string between two agents
> attached to the same node.
> I've looked at the documentation and at some examples but can not figure
> it out by myself.  I am sorry to be bothering you, but I honestly can't
> figure this out as I don't have any experience using C++ or tcl...
> 
> As my mailing has been ignored, I assume that I am violating some
> unwritten rules of this list.  Please, at least tell me what exactly am I
> doing wrong?  I _have_ looked at documentation and some examples...
> 
> set tcp_src1 [new Agent/TCP]
> set tcp_snk1 [new Agent/TCPSink]
> 
> $ns_ attach-agent $n0 $tcp_src1
> $ns_ attach-agent $n0 $tcp_snk1
> 
> In the actual source code of TCPSink, how would one go about passing a
> message to the TCP agent when something is received
> (in Agent/TCPSink::recv(Packet* pkt, Handler*) function)
> 
> Please do not ignore this request as my (undergraduate) thesis is going to
> burn if I don't figure this out soon.
> 
> Thank you very much
> Alex.
> 
>