Re: asynchronous comunication, wxPython and threads.

2005-06-22 Thread Zunbeltz Izaola
On Wed, 22 Jun 2005 09:28:31 -0400, Peter Hansen wrote: > Almost certainly it is. It would be simplest to set up a worker thread > once, when the GUI thread begins, and simply send requests to it via a > Queue. It can create the socket, connect to the server, communicate, > close it down, an

Re: asynchronous comunication, wxPython and threads.

2005-06-22 Thread Peter Hansen
Zunbeltz Izaola wrote: > I opened the socket once (i don't know if > itit is important to open inside or outside the comunication thread). I don't believe it is important where it is opened, provided you don't try to do things with it from two threads at a time (without adequate protection). >

Re: asynchronous comunication, wxPython and threads.

2005-06-22 Thread Zunbeltz Izaola
On Tue, 21 Jun 2005 11:07:35 -0400, Peter Hansen wrote: > > Please clarify: what does this mean? "Sending a socket" is not a usual > way to describe TCP communications. Do you mean your program _opens_ a > socket (like a phone connection) and _sends_ some data, then waits for > data to be re

Re: asynchronous comunication, wxPython and threads.

2005-06-21 Thread Peter Hansen
Zunbeltz Izaola wrote: > 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 measu

Re: asynchronous comunication, wxPython and threads.

2005-06-21 Thread Zunbeltz Izaola
On Tue, 21 Jun 2005 15:30:41 +0100, Toby Dickenson wrote: > On Tuesday 21 June 2005 14:22, Zunbeltz Izaola wrote: > > > I guess you are accessing the socket from both your GUI thread and > communications thread. Dont do that. An action in the GUI thread should > signal the communictions thread

Re: asynchronous comunication, wxPython and threads.

2005-06-21 Thread Toby Dickenson
On Tuesday 21 June 2005 14:22, Zunbeltz Izaola wrote: > 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 guess you

asynchronous comunication, wxPython and threads.

2005-06-21 Thread Zunbeltz Izaola
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