thank you very much! very useful!!
> Date: Tue, 4 Jan 2011 22:48:26 +0100 > From: jardas...@gmail.com > To: jpablolorenze...@hotmail.com > CC: gtk-app-devel-list@gnome.org > Subject: Re: resetting timeout source > > Well, I cannot find anything in glib. If you use linux, you can use > timerfd_create() to create pollable timer, create new GSource, attach > the descriptor and you got your timer. Set intervals to zero to stop it, > descriptor will get no more read events, and you don't even need to > detach the source from event loop. You can 'reset' the timer without > stopping it first. > > On 12/25/2010 12:48 AM, Juan Pablo L. wrote: > > > > Hi, i m making an application which needs to perform a small task evey X > > secs, it will disconnect from a server if X seconds have passed without the > > aplication sending anything to the server, but if before completing the X > > secs i send something to the server i have to reset the timer for another X > > secs and so on like that all the time .... but my problem is that i can not > > find a way of resetting the timer without destroying and recreating the > > time again and again and again ..... which i find it too much for just the > > small task of resetting the timer, in other words i do not want to be > > freeing and getting new memory all the time i find that to be very > > inefficient and there should not be any need for it, so is there anyway to > > reset the timer without releasing its memory and getting memory all the > > time ? i know that if the callback function returns FALSE the source will > > not be added in the loop again so i guess i can just attach it again but > > that will only work when the time r > ex > > pires so that will not help when the timer has not yet expired and i need > > to reset it for another X secs. So should know that i m attaching the > > timer to a non default main loop (it is a main loop inside a thread). any > > ideas will be very helpful. thanks!!! > > > > _______________________________________________ > > gtk-app-devel-list mailing list > > gtk-app-devel-list@gnome.org > > http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list _______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list