Hi, I have the following problem.
I'm developing a GUI program (wxPython). This program has to comunicate (TCP) whit other program that controls a laboratory machine to do a measurement. I have a dialog box, wiht two buttoms "Start measurement" and "Stop". "Start" executes a function that do the measurement in the following way. 1) My program send a socket. 2) The other program recives it an send confirmation. 3) My program waits for the confirmation and send the next when confirmation received. This comunication is done in a new thread not to frezee the GUI. The problem is that when "Stop" is done (it kills the thread) some confirmation sockets are mixed (are not receibed in the correct order although i use tcp). I have been told not to do comunication in a new thread; instead, I should use asyncronus comunication. My question: What module should i use, asyncore, asynchat, twisted,(anohter) How can i implement this asynchronous comunication and the ability to stop this long run funciton (the measurement can take hours or days, so i need a way to stop it)? Can asynchronous comunication garantee that the confirmation socket will arrive in the correct order (one after each sended socket)? Thanks for your help Zunbeltz Izaola -- http://mail.python.org/mailman/listinfo/python-list