Re: networkshit without fucking up the interface?



networkshit without fucking up the interface?

ahem ;-)

Am Son, 2001-12-16 um 18.32 schrieb Kent Nyberg (Telia):
Hello!
Is it possible to use alot of networkfunctions in a 
C/Gtk+/Gnome program without making the interface unusable
when the network-functions are running?
Like, i press a button to read alot of things from a tcp connection but i still want the interafce to be 
usable.

I do recall reading that bad code can do this.. make the interace unusable.
Can some one tell me if im right or wrong.. ? :)

You're right, if you start a call-back-function that waits at a blocking
filedescriptor. So, you should use a non-blocking filedescriptor and the
gdk input functions. Use them to monitor your filedescriptor and start a
call-back-function when something happens.
(http://developer.gnome.org/doc/API/gdk/gdk-input.html)

Maybe doing some kind of threading will help me? 
I have never done threading so i dont realy know what to do :)

Threading would help you, yes. But threading is more difficult than the 
way I descriped above, and most likely overkill. And as far as I know,
it is not recommended to use threads together with gtk, though it is
possible.

Jörgen
 
-- 
There are two major products that come from Berkeley : LSD and UNIX. We
don't believe this to be a coincidence.

Jeremy S. Anderson




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]