Re: Re: [Gambas-devel] About Watching and Wait()
Brought to you by:
gambas
From: <dan...@ne...> - 2003-10-29 08:34:49
|
>I must implement the same thing in the interpreter, so that you can watch= file = >descriptors AND call the WAIT instruction without using the QT component.= = > = >I will do that as soon as possible, so that it is in the next version. = --------------------------------- = OK, l'll =22Wait=22 a little :) = ------------------------------------ = = >Only ONE component can implement the event loop, i.e. the watch and the w= ait = >hooks. So the last loaded component implementing them wins. = > = >This event loop is the ONLY one function that can block the interpreter b= y = >calling select(). So your networking component, for example, must not cal= l = >accept() directly for example. It must instead watch the socket file = >descriptor by calling GB.Watch(), return to the event loop, and call acce= pt() = >at the beginning of the watch callback. = > = >It seems that you already did the good thing in your code :-) = > = >But I see that you raised an event into a callback : never do that =21 Be= cause = >it can lead to infinite loops. The event can call a gambas event handler = that = >may return raise the same callback. You must use instead GB.Post() to pos= t a = >function that will be call at the return of the event loop. = ------------------------------------ = I'll implement it on next version on =22networking=22 component. = = Thanks for you reply=21 = = Regards, = = Daniel Campos = = ------------------------------------------------------------- NetCourrier, votre bureau virtuel sur Internet : Mail, Agenda, Clubs, Tool= bar... Web/Wap : www.netcourrier.com T=E9l=E9phone/Fax : 08 92 69 00 21 (0,34 =80 TTC/min) Minitel: 3615 NETCOURRIER (0,16 =80 TTC/min) |