How to capture a timeout of 15min inactivity?

39 views
Skip to first unread message

mongoos...@gmail.com

unread,
Sep 21, 2015, 10:05:35 AM9/21/15
to mongoose-users


Dear list,

I want to "do something" in my main code after 15 min of inactivity. Therefore I was looking into  mg_poll_server() for signal(). The return value of mg_poll_server() is a time!! instead of 0=capture -1=error. My question is how would you realise the 15min timeout (without changing too much in mongoose.c).

I was looking for a solution like this:
int ret=0;

for (;;)
   
{
        ret
= mg_poll_server(server, 15*60*1000);   //15min timeout

       
if(ret == 0)
       
{
         
//do sth here
       
}

   
}//end for

Sergey Lyubka

unread,
Sep 27, 2015, 10:57:52 AM9/27/15
to mongoose-users
With new Mongoose 6.0, you can iterate over all connections and get the latest IO timestamp.

--
You received this message because you are subscribed to the Google Groups "mongoose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongoose-user...@googlegroups.com.
To post to this group, send email to mongoos...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongoose-users.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages