How to sleep in ns3

338 views
Skip to first unread message

Mateus Sousa

unread,
Apr 4, 2017, 9:07:15 PM4/4/17
to ns-3-users
Hi again,

I'm simulating a VANETs environment in ns3 and I need to simulate a simple processing, here are the steps:
(1) Client send one task to server;
(2) Server process the task (sleep);
(3) Server send back the results;

I tried to use the sleep function but it doesn't work (I need to get this sleep time to calculate the RTT)).

Anyone can tell me a way to do this?

Konstantinos

unread,
Apr 5, 2017, 3:54:14 AM4/5/17
to ns-3-users
Hi,

By 'sleep' you simply want to delay the reply? You can easily do that with Simulator::Schedule.
You can schedule the 'send' at specific time.
Reply all
Reply to author
Forward
0 new messages