[comp.windows.x] ICCCM & Properties

adri@dutncp8.tudelft.nl (A.B. van Woerkom) (04/24/91)

alex@hpgnd.grenoble.hp.com (Alexis MERMET-GRANDFILLES) writes:


>2/

>I am trying to find out what is the best way to transfer quite a big
>amount of Data ( Several KBytes ) between 2 X clients.

>In fact, I am thinking of a X11 client which acts as a server for many
>other clients. On the request of those clients, this 'server'
>would send somehow some kind of data, from a few bytes to several KBytes
>to the requesting client.

>I was thinking of writing the complete buffer into a pre-defined root
>window property, and then , sending a ClientMessage to the waiting client
>to tell him the data is ready and where it is.


>Does this sound feasable ?

Sounds like reinventing the wheel.  The Xt-intrinsics offer a set of functions
that implement the so-called selection mechanism.  Using this mechanism it is
quite easy to transfer large amounts of data from one client to the other;
when the amount meets a limit the intrinsics will handle the chopping in chunks
for you.
So, have a look at XtOwnSelection and friends.
--
A.B. van Woerkom, adri@dutncp6.tudelft.nl
Delft University of Technology, Faculty of Applied Physics, Physics
Informatics Group, section Computational Physics, Lorentzweg 1,
2628 CJ  DELFT, The Netherlands
________________________________________________________________________
"Unfortunately, the current generation of mail programs do not have checkers
 to see if the sender knows what he is talking about" (A.S. Tanenbaum)

smgf@cl.cam.ac.uk (Steve Freeman) (04/30/91)

In article <adri.672479588@dutncp8> adri@dutncp8.tudelft.nl (A.B. van Woerkom) writes:
>alex@hpgnd.grenoble.hp.com (Alexis MERMET-GRANDFILLES) writes:
>>I am trying to find out what is the best way to transfer quite a big
>>amount of Data ( Several KBytes ) between 2 X clients.
>>
>>In fact, I am thinking of a X11 client which acts as a server for many
>>other clients. On the request of those clients, this 'server'
>>would send somehow some kind of data, from a few bytes to several KBytes
>>to the requesting client.
>
>Sounds like reinventing the wheel.  The Xt-intrinsics offer a set of functions
>that implement the so-called selection mechanism.  Using this mechanism it is
>quite easy to transfer large amounts of data from one client to the other;
>when the amount meets a limit the intrinsics will handle the chopping in chunks
>for you.

A couple of things to consider: Your X server will effectively be locked
during the transfer, so you need, at least, to show the user that something
is happening and the the machine hasn't just died. On a slow machine with
process swaps, etc., it is possible that the transfer may time out for large
amounts of data, so you need to allow for recovery, etc. The Xt selection
transfer doesn't seem to take any notice of the size of the data when 
deciding about timeouts.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Steve Freeman, Computer Lab, University of Cambridge, UK
Steve.Freeman@computer-lab.cambridge.ac.uk

"The science of medicine is founded on conjecture and improved by murder"
   Sir Astley Cooper.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Steve Freeman, Computer Lab, University of Cambridge, UK
Steve.Freeman@computer-lab.cambridge.ac.uk