Re: Regd ev_timer

2013-04-02 Thread Varun Chandramohan
Hi Jann, Sorry for psudo code and bad format. I put only the pseudo code because it will easier to see if there is a logical flaw. This is not to check for internet connectivity. In my actual code I use IP address not resolving. This is just test code so I have the same. Please excuse me. With

Re: Regd ev_timer

2013-04-02 Thread Jann Horn
On Wed, Apr 03, 2013 at 09:27:31AM +1100, Varun Chandramohan wrote: Hi Jann, Sorry for psudo code and bad format. I put only the pseudo code because it will easier to see if there is a logical flaw. This is not to check for internet connectivity. In my actual code I use IP address not

Re: Regd ev_timer

2013-04-02 Thread Varun Chandramohan
Hi Jann, Yeah, thanks for picking that up. Yes I will reset the timer. Just a question, so at line 78 if I removed if (events EV_TIMEOUT) { } check will it be an issue. I dont see anything else calling this call back apart from this event. May be EV_ERROR perhaps? Also if you have time revert

Re: Regd ev_timer

2013-04-02 Thread Jann Horn
On Wed, Apr 03, 2013 at 09:54:46AM +1100, Varun Chandramohan wrote: Hi Jann, Yeah, thanks for picking that up. Yes I will reset the timer. Just a question, so at line 78 if I removed if (events EV_TIMEOUT) { } check will it be an issue. I dont see anything else calling this call back apart

Re: Regd ev_timer

2013-04-02 Thread Marc Lehmann
On Wed, Apr 03, 2013 at 09:54:46AM +1100, Varun Chandramohan cvarunen...@gmail.com wrote: question, so at line 78 if I removed if (events EV_TIMEOUT) { } check will it be an issue. I dont see anything else calling this call back apart from this event. May be EV_ERROR perhaps? The revents

Regd ev_timer

2013-04-01 Thread Varun Chandramohan
Hi Folks, Iam trying to understand the timer behaviour using a simple program. Let me first post the pseudo code. /*global */ #define DEFAULT_CONNECT_TIMER 7.0 struct ps_hb { ev_io io; ev_timer timer; int sd; struct sockaddr_in serveraddr; }ps_hb; int init_ps(struct ps_hb