Пример #1
0
static void
onTimer( int fd UNUSED, short what UNUSED, void * vshared )
{
    tr_shared * s = vshared;

    assert( s );
    assert( s->timer );

    /* do something */
    natPulse( s, s->doPortCheck );
    s->doPortCheck = FALSE;

    /* set up the timer for the next pulse */
    set_evtimer_from_status( s );
}
static void
start_timer( tr_shared * s )
{
    s->timer = evtimer_new( s->session->event_base, onTimer, s );
    set_evtimer_from_status( s );
}