TipcEventCreateTimer create a timer event
T_IPC_EVENT TipcEventCreatTimer(dispatcher
,interval
,event_func
,event_arg
) T_IPC_DISPATCHERdispatcher
; T_REAL8interval
; T_IPC_EVENT_FUNCevent_func
; T_PTRevent_arg
;
dispatcher
the dispatcher on which to invoke the event
interval
the timer interval
event_func
the function to be invoked
event_arg
an optional argument to pass to the event_func
A new event if successful, NULL
otherwise.
If TipcEventCreateTimer fails, it returns FALSE
and sets the global SmartSockets error number to one of:
TipcEventCreateTimer creates a timer event of type T_IPC_EVENT_TIMER to be invoked every interval
seconds on the specified dispatcher. If the timer is to be invoked only once, destroy the event in the event_func
after the first time it executes.
None
TipcEventGetType, TipcEventGetInterval, TipcEventSetInterval
This example creates a timer event and modifies the event’s interval within the invoked function:
void T_ENTRY timerFunc(T_IPC_EVENT event, T_IPC_EVENT_DATA data, T_PTR arg) { T_REAL8 interval; if (!TipcEventGetInterval(event, &interval)) {
return
; /* error */
}/* Double the interval */
if (!TipcEventSetInterval(event, interval * 2.0)) {
return
; /* error */
} } /* =========================================================== *//*...code from main program is below */
event = TipcEventCreateTimer(dispatcher, 1.0, timerFunc, T_NULL); if (event == NULL) {
return
; /* error */
}
TIBCO SmartSockets™ Application Programming Interface Software Release 6.8, July 2006 Copyright © TIBCO Software Inc. All rights reserved www.tibco.com |