[Glade-users] A problem with using threads and socket with Glade

Tristan Van Berkom tvb at gnome.org
Mon May 7 09:40:33 EDT 2007


On Fri, 2007-05-04 at 23:11 +0700, Zuan noc wrote:
> Can i use all the functions in pthread.h and sys/socket.h with Glade
> programming ?
> (example : pthread_create,...,connect , accept...).
> If not , can you tell me the way using threads and sockets in Glade
> programming ? 

pthread_create: Technically yes you could, but when using glib/gtk+, 
I'd recommend using the GThread api for threading - most importantly IMO
is that you dont mix GThread/pthread apis together.

As for connect/accept, there is no such api in glib to help you there,
so you should go ahead and use the posix api for that, you can look
into GIOChannel and GIOWatch that will help you integrate file
desctriptor events into your main loop.

Cheers,
               -Tristan




More information about the Glade-users mailing list