SCTP Discussions

Text archives Help


Re: [SCTP-Discussion] Details about Timer.


Chronological Thread 
  • From: Andreas Jungmaier <ajung AT exp-math.uni-essen.de>
  • To: discussion AT sctp.de
  • Subject: Re: [SCTP-Discussion] Details about Timer.
  • Date: Tue Aug 7 14:48:01 2001
  • List-id: SCTP Discussions <discussion.sctp.de>

Salbrechter Bernd schrieb:
>
> Hello all!

Hi !

> I'm need timer in my application, which uses the SCTP adaption layer.
>
> I'm quite shure what sctp_startTimer do and hope that sctp_stopTimer removes
> the timer completly.

That is what it is supposed to do ! :-)
>
> But could I use sctp_restartTimer, if I want to trigger the timer caused the
> currently processed timeout again. Or will a timer that triggers automaticly
> deleted?

No, once a timer expires, it is removed from the list of timer
events. So if you start one timer only, which fires after the
timer period and executes your callback, then the timerlist will
not contain any more entries. Hence there is nothing that can be
restarted.
>
> In other words: Will the following C-fragment work or not?
>
> void timeout(
> unsigned int timerid,
> void * p1
> void * p2)
> {
> sctp_restartTimer(timerid, 1000); /* Call me again one seconde later.
> */
> }

timerid would be uninitialized in this case, anyway, so
that would not work !

>
> int
> main(
> int argc,
> char **argv)
> {
> /* Some initailization. */
>
> (void) sctp_startTimer(1000, timeout, NULL, NULL);
>
> /* The SCTP mainloop. */
> }

And the return value of the startTimer funtion needs
to be stored, as it is the timer id, which can be used
to call stop or restart.

Hope that helps,

Andreas

--
---------------------------------------------------------------------------
Dipl.-Ing. Andreas Jungmaier | _
Computer Networking Technology Group | ASCII ribbon campaign ( )
University of Essen | - against HTML email X
http://www.exp-math.uni-essen.de/~ajung | & vcards / \




Archive powered by MHonArc 2.6.19+.

Top of page