Re: communication strategy between widget and background programs [message #41001] |
Thu, 16 September 2004 18:57 |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
Benjamin Hornberger <benjamin.hornberger@stonybrook.edu> writes:
> I was hoping the bright minds out there might have some useful comments
> on the following problem:
>
> We are writing control software for an X-ray microscope. The instrument
> itself is controlled by software written in C++, while a GUI (including
> some image processing features) is witten in IDL. The two are
> communicating via an IDL client and a C++ server, who talk to each other
> through TCP/IP sockets.
>
> One important characteristic of our client/server scheme is that they
> communicate asynchronously, meaning that the client sends request
> without expecting an immediate reply. The server will send the reply
> independently at some point later. This is already implemented and
> unlikely to be changed, even though it is the cause of some big headaches.
If you are using IDL's SOCKET command, then in principle you can set
the read and write time-outs to zero, or at least a very small number.
Then you can poll the socket periodically for the required response
without blocking your whole GUI application.
I did a simple test on Linux (IDL 6.0), and found that I could set the
read timeout to 0.01 sec.
Of course after the time-out, you will need to catch the I/O error,
but that is easy to do with ON_IOERROR.
Good luck,
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|