HP-UX C SIP Stack Programmer's Guide (Novembery 2007)
Working with the Mid-Layer 431
Mid-layer Timer API
RvSipMidTimerSet()
Creates and sets a new application timer. This function returns a handle to the
new timer object. When calling this function the application can supply a
callback function pointer that will be called when the timer expires. The
application can also supply a context that will be given back as one of the
callback function parameters. To reset the timer, call RvSipMidTimerReset(). If
the timer has expired, there is no need to call RvSipMidTimerReset().
RvSipMidTimerReset()
Releases an application timer and frees all its resources. The callback given in
RvSipMidTimerSet() will not be called. You should not call
RvSipMidTimerReset() inside the expiration callback.
EVENTS The following is the timer expiration event:
RvSipMidTimerExpEv()
Notifies the application that a timer has expired. The timer resources will be
freed automatically.
TIMER UTILITY
FUNCTIONS
The following are the timer utility functions:
RvSipMidTimeInMilliGet()
Gets the time in milliseconds.
RvSipMidTimeInSecondsGet()
Gets the time in seconds.
S
AMPLE CODE The following sample code will print the time one second after the timer was
set.
/* A callback to execute when the timer expires */
static void RVCALLCONV TellTime(IN void* context)
{
printf("Time In Seconds is: %d\n",
RvSipMidTimeInSecondsGet());
}
void TellTimeInOneSecond(RvSipMidMgrHandle hMidMgr)