xxai121@ut-emx.UUCP (Tim Jones) (08/18/90)
I am trying to develop a way for about ten X Windows programs to communicate with each other through the X Window interclient communication mechanism. There are basically two modes of communication: a program having data that other programs can come and get (passive send / active receive), or a program desiring data whenever other programs send it (passive receive / active send). No assumptions are being made about the operating system the programs are running under, or that they are even on the same machine. It is assumed that they are using the same X server. We are using X version 11.3 and the Motif toolkit. Generally our messages are short (1-20 bytes). Right now we have a system using the Intrinsics' selection mechanism that allows two different programs to communicate in either mode. The passive send / active receive is implemented with standard selections. The passive receive / active send is also implemented with selections, where the selection is an Atom that represents a program's identity (we have established a set of known program identity atoms). By asking for this selection, and indicating a desiredconversion type, another program indicates that data is available for the identified program wanting the data (the kind of data being represented by the conversion type). Although it uses a nonstandard interpretation of the conversion type, this mechanism provides the desired communication modes between two unique programs. It also handles the case of multiple programs wanting the same data (they are notified individually and individually come get the data). The current system has some limitations we need to overcome. First, it does not handle the case of multiple versions of the same program running at the same time. We are using a known selection atom to represent each program and it is not possible for more than one program (or window) to own the same selection atom. One current idea is to implement a system of undetermined selection atoms representing each program; however this would involve each program notifying all other programs whenever it starts or ends, and what its identifying atom is. This seems to have the benefit of allowing multiple versions of the programs to communicate with each other in both modes, but the drawback of each program having to keep track of all the other programs' atoms. A second limitation is not handling the case where more than one program has the same kind of data for other programs to read. That is, it cannot handle the case of two copies of program A and B both trying to do a passive send / active receive of the same data. This is characteristic of the selection mechanism, which only allows one program to own a particular selection. The "undetermined atom" idea does not solve this problem. Basically we are wanting a system that handles both modes of communication and the cases involved with multiple versions of multiple programs communicating with each other through the same X server. Does anyone out there with experience in this kind of thing have some suggestions? Right now we are just using selections. Has anyone implemented a similar system using client message events, property notify events, the Motif clipboard, or some other mechanism? Does anyone have some ideas? I would appreciate any responses, Tim Jones Note: my computer will be shut down from 8/27 to 9/4. Any mail sent during that time should be sent via a friend at chris@nth.com