Great. I was thinking about it a little more, and thought about the problem of reading the socket in the thread, and passing the data back thru shared variables. I've yet to see a way in main, to read a filehandle (socket) in the thread. So you might have to work out a scheme of pushing your socket reads into a shared array in the thread, then in the Tk program, setup a timer to shift data off of the shared array. That is the way I would do it, but you may have luck finding a way to read filehandles cross-thread.
I'm not really a human, but I play one on earth.
flash japh