Hi,

I need to connect agents dynamically for my purpose, so i have changed the
agent.cc code as suggested by the comments in it.

/* This function is a placeholder in case applications want to dynamically
*  connect to agents (presently, must be done at configuration time).
*/
void Agent::connect(nsaddr_t dst)
{

         dst_ = dst;

}

Then i get the following compilation error:

common/agent.cc: In member function ‘virtual void
Agent::connect(nsaddr_t)’:
common/agent.cc:393: error: no match for ‘operator=’ in
‘((Agent*)this)->Agent::dst_ = dst’
./config.h:80: note: candidates are: ns_addr_t& ns_addr_t::operator=(const
ns_addr_t&)
make: *** [common/agent.o] Error 1


Kindly tell me where i am going wrong. I have searched the ns-users list
and someone had posted a similar question in Jan 2001, and there is no
reply to that querry.


What i need to do is the following:  Use a single agent to send packets to
multiple agents sitting on diff nodes. I need the freedom to choose the
destination agent in my agent C++ code depending upon the case.

So one way of doing this would to dynamically connect the agents in the
c++ code using the function (connect((nsaddr_t)atoi("_o480")); where _0480
is the value returned by ns for "$my-dst-agent"

Or i could create n(n-1) agents for connecting each of the node pairs (n
nodes). I would prefer to use the first method. Kindly tell me if my
thinking is wrong somewhere.

Thank you for your patient reading

Yours Sincerely,
OVS Bharadwaj
EE, IITB

Reply via email to