[Gambas-devel] About Watching and Wait()

Daniel Campos danielcampos at ...45...
Mon Oct 27 22:21:15 CET 2003


Hello Benoît (and company):

 I was trying to create a little program using my "networking"
component, but without using "QT" component. I could see that watching
process was not working at all, and then I saw at Gambas Wiki that
Wait() works only if "QT" component is present. The code is very simple:

...
Socket.ConnectSocket("localhost",7)
While Socket.Status <> 7  ' while connection is not completed
	Wait (0.1)
	Print "Connecting..."
Loop
...

Using this code, with QT all works OK, without QT loop never ends,
as networking needs callbacks provided by GB.Watch().

So I tried to use hooks in main file. Watch hook seems to do nothing
(I don't know if it is really implemented), but then I used Wait hook,
and calling "by hand" to the methods I use to control socket status
all worked fine.

 However, I have a question : It seems that gambas runtime only calls
my Wait function when QT is not used in the program, so if in
the future another component is using a watch hook, and gambas runtime
decides to use the other's watch hook instead of mine, network component
could not work at all... It sound like incompatible components in
gambas!

 Please tell me something about this as I don't understand it very well,
I would like to make work with networking possible even if there's
not any graphic library installed.

Regards,
  
-- 
Daniel Campos <danielcampos at ...45...>





More information about the Devel mailing list