[Gambas-devel] About Watching and Wait()

danielcampos at ...45... danielcampos at ...45...
Wed Oct 29 09:34:47 CET 2003


>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 "Wait" a little :) 
------------------------------------ 
 
>Only ONE component can implement the event loop, i.e. the watch and the wait  
>hooks. So the last loaded component implementing them wins. 
> 
>This event loop is the ONLY one function that can block the interpreter by  
>calling select(). So your networking component, for example, must not call  
>accept() directly for example. It must instead watch the socket file  
>descriptor by calling GB.Watch(), return to the event loop, and call accept()  
>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 ! Because  
>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 post a  
>function that will be call at the return of the event loop. 
------------------------------------ 
I'll implement it on next version on "networking" component. 
 
Thanks for you reply! 
 
Regards, 
 
Daniel Campos 
 

-------------------------------------------------------------
NetCourrier, votre bureau virtuel sur Internet : Mail, Agenda, Clubs, Toolbar...
Web/Wap : www.netcourrier.com
Téléphone/Fax : 08 92 69 00 21 (0,34 € TTC/min)
Minitel: 3615 NETCOURRIER (0,16 € TTC/min)





More information about the Devel mailing list