silc_fsm_next_later

SYNOPSIS

    void silc_fsm_next_later(void *fsm, SilcFSMStateCallback next_state,
                             SilcUInt32 seconds, SilcUInt32 useconds);

DESCRIPTION

Set the next state to be executed later, at the specified time. The SILC_FSM_WAIT must be returned in the state function if this function is called. If any other state is returned machine operation is undefined. The machine or thread will move to `next_state' after the specified timeout. This function is used with both SilcFSM and SilcFSMThread contexts.

NOTES

If both `seconds' and `useconds' are 0, the effect is same as calling silc_fsm_next function, and SILC_FSM_CONTINUE must be returned.

If silc_fsm_continue or silc_fsm_continue_sync is called while the machine or thread is in SILC_FSM_WAIT state the timeout is automatically canceled and the state moves to the next state.

EXAMPLE

    // Move to next state after 10 seconds
    silc_fsm_next_later(fsm, next_state, 10, 0);
    return SILC_FSM_WAIT;