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

how to cancel an event from the scheduler ?



hi all,

Can anybody tell me how to cancel an event after scheduling it through
the "at" command of NS.
To be more clear : I am doing the following :
for example, I generate the event :

$ns at t1 "processing1"  but few seconds after this scheduling 
(and before t1), I may have to cancel the execution of "processing1"
and I wonder how to use the scheduler "cancel" command ?
I looked to the scheduler.cc command function then, I sow the following
:


     if (argc == 3) {
		if (strcmp(argv[1], "at") == 0 ||
		    strcmp(argv[1], "cancel") == 0) {
			Event* p = lookup(atoi(argv[2]));
			if (p != 0) {
				/*XXX make sure it really is an atevent*/
				cancel(p);
				AtEvent* ae = (AtEvent*)p;
				delete[] ae->proc_;
				delete ae;
			}




my question is waht "argv[2]" has to be in my example beleow ( for
canceling "processing1") ?
or there is any other way ?

Many thanks in advance for any help.

best regards

Maohamed Vall EL ALEM
	Paris