how to set timer?

supergui nginx-forum at nginx.us
Fri Jul 24 04:37:11 MSD 2009


////////////////////////////////////////////////////////////////////////////////////////////////////////////
static ngx_event_t gdrive_timer_wev;
static ngx_connection_t  dumb;

ngx_int_t ngx_http_gdrive_init_process(ngx_cycle_t *cycle) 
{
   ngx_log_error(NGX_LOG_DEBUG, cycle->log, 0, "set gdrive timer");
   gdrive_timer_wev.handler=test_timer;
   gdrive_timer_wev.log=cycle->log;
   gdrive_timer_wev.data=&dumb;
   dumb.fd=(ngx_socket_t)-1;
   ngx_add_timer(&gdrive_timer_wev, 5000);
   return NGX_OK;
}

static
void test_timer(ngx_event_t *wev)
{
        ngx_log_error(NGX_LOG_DEBUG, wev->log, 0, "gdrive timer out");
        //printf("print time out\n");
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////


why this doesn't work?

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,4265,4312#msg-4312






More information about the nginx mailing list