Hi all,
I'm a new user of NS-3. When coding for that, I have a quick question that:
1. whether Simulator::Schedule() does a real delay/sleep for that node, or it just triggers the function after 'delay' seconds.
For example, I have two consecutive lines of code:
Simulator::Schedule(Seconds(5.0), &SWIM::TimeoutCheck, this);
Simulator::Schedule(Seconds(2.0), &SWIM::SendPacket, this);
Then, will the the node do Timeout first at t=5 and do SendPacket at t=2 or do SendPacket first?
2. Will the SetRecvCallback() blocks other operations when waiting for the packets?
For example
socket_recv->SetRecvCallback (MakeCallback (&SWIM::HandleRead, this));
while (1) {
Simulator::Schedule(Seconds(5.0), &SWIM::SendPacket, this);
}
In this case, could the SendPacket (using another socket socket_send) run periodically and the HandleRead() is triggered normally (for example, also 5 seconds once)?
I try to test this by myself about this, but I keep failing in compiling part, so I want to guarantees that my logic/understanding of the NS3 behaviors are correct. Thanks!
Thanks in advance.