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

Re: Scheduler::cancel()



On Fri, 16 Oct 1998 11:13:13 CDT, Zhenhai Duan wrote: 
>Is there anyway to know that "I" am sending traffic? For example, at the
>end of simulation, I need to stop all the traffic source, but some source
>are sending traffic, while others not(in a on-off model). Normally we need
>to cancel some pending event at this step, But I do not know whether or
>not there is event pending. So if I call cancel(), there should be some
>error in ns1. So I want to know:
>
>How can I know there is event pending or not before I cancal event.

How about keeping track of the uid of the event when you schedule it
and do Simulator:lookup to see if it's still there.

As an alternative, why not just exit with some traffic in flight?

   -John Heidemann