Tkinter and asyncronous socket



Hi all, I'm new to python and I've been spending the last week on GUI
that refresh its content based on data periodically coming from a
remote socket.
I succeded in doing it (thanks newsgroups and online manual!) using
the Tkinter.after method to implement a busy wait on the socket (which
I had previously set to non blocking)
I should be happy with it, but on windows (application must be multi-
platform) the busy wait leads to a 100% CPU usage. I'm trying to
implement it the other way round: a "socket process" that updates a
label (or a queue object) in the GUI. I can't figure out how to do
this. Anyone can post hints? With some details, maybe?

Thanks all

Max
.



Relevant Pages

  • Re: Looking for information on MFC TCP Communication
    ... > Note that to use the MFC socket classes the separate threads must be UI threads, ... > there is rarely a need to use separate threads. ... > objects, and not touching the GUI, there are no "thread issues". ... allocate the buffer, but this may be allocating / deleting alot of ...
    (microsoft.public.vc.mfc)
  • Re: tcp connection in gui: event based
    ... Write a small proc that does the accept and sets the connection to ... Use to register procs that get fired when the socket is ... If you have a full line, send it to the GUI, maybe dispatching via ... after to not block the event loop if its a bit bigger ...
    (comp.lang.tcl)
  • Re: Using too many threads?
    ... - Only the main window thread may update the main window GUI. ... Only the details window thread may update the details GUI. ... Is it safe for multiple threads to be reading/writing the same socket? ... "connection controller" thread per connection: ...
    (comp.os.os2.programmer.misc)
  • Re: Cant display Java gui
    ... Have the GUI listen on a localhost socket for a ... and pop up the GUI when it receives one. ... > It also means that you can properly queue the emails for the operator's ... Thanks, Rogan! ...
    (comp.lang.java.programmer)
  • Re: Cant display Java gui
    ... and pop up the GUI when it receives one. ... >>and returns the decision to your C program via the socket. ... Thanks, Rogan! ... Please respond to "nntp AT dawes DOT za DOT net" ...
    (comp.lang.java.programmer)