Skip to content Skip to sidebar Skip to footer

Socket Thread And Pygtk

I'm trying to write a instant messaging program, the basic ui is almost finished and i'm looking into the receiving part of messages. I have an UI class and a threaded Receive_Sock

Solution 1:

  1. No. Don't use threads. Instead, use glib.io_add_watch to make gtk/glib itself call your function when the socket is ready to read. That way you won't freeze your gui and won't need threads. You also won't need idle_add.

  2. If you do 1, you won't have this problem, since messages will arrive in order and there will be no concurrent threads to confuse the data.

Post a Comment for "Socket Thread And Pygtk"