void
tr_sharedPortChanged( tr_session * session )
{
    tr_shared * s = session->shared;

    if( s->isEnabled )
    {
        stop_timer( s );
        natPulse( s, false );
        start_timer( s );
    }
}
Exemplo n.º 2
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 );
}
Exemplo n.º 3
0
static void
stop_forwarding( tr_shared * s )
{
    tr_ninf( getKey( ), "%s", _( "Stopped" ) );
    natPulse( s, FALSE );

    tr_natpmpClose( s->natpmp );
    s->natpmp = NULL;
    s->natpmpStatus = TR_PORT_UNMAPPED;

    tr_upnpClose( s->upnp );
    s->upnp = NULL;
    s->upnpStatus = TR_PORT_UNMAPPED;

    stop_timer( s );
}