Path: utzoo!attcan!uunet!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!src.honeywell.com!msi.umn.edu!cs.umn.edu!kksys!com50!pai!erc From: erc@pai.UUCP (Eric Johnson) Newsgroups: comp.windows.x Subject: Re: Interclient Communication Summary: XSendEvent() Keywords: Property SendEvent ClientMessage Message-ID: <1506@pai.UUCP> Date: 26 Oct 90 13:43:54 GMT References: <880@kivax.UUCP> Organization: Boulware Technologies, Inc., Burnsville, MN Lines: 54 In article <880@kivax.UUCP>, koe@kivax.UUCP (Diana Koehler) writes: > I am just working with the different mechanisms of > interclient communication. What method should I use > - to exchange data between clients ? > (Properties or XSendEvent, with type ClientMessage) > - to notify a client without sending data (in sense of semaphores) I'm assuming you mean you want to only send short messages between your clients. The X Window System is not intended to be a generic inter-process communication (IPC) system. If you want to send large amounts of data, you'll probably have a better time with sockets, streams, shared memory or some other IPC technique. A common technique for X Window applications to exchange short messages is to: 1) Append your application's window ID to a "known" property on the root window. By known property I mean a property that all your applications agree to beforehand. The window ID is necessary for using XSendEvent(). Window IDs also will change each time you run your applications, so writing the window ID to a property solves the tough problem of finding the window IDs of the applications you want to communicate with. 2) Use XSendEvent() to send short messages to the applications that have registered an interest in those messages (that is, those applications that have appended their window IDs to the property on the root window). The ClientMessage event type allows you to send 20 bytes of arbitrary data with each message. Another cute thing is to send KeyPress/KeyRelease events to an application and pretned the user actually typed the keys. (This is useful for application testing, too.) There's a whole chapter on sending events in Advanced X Window Applications Programming (a book I'm responsible for). Send me e-mail if you would like more information on this. > Thanks > Diana Koehler Tel.: +49 7721 867034 > Mannesmann Kienzle GmbH > Abt. 011.2 e-mail: koe@kivax.UUCP > Postfach 1640 ..!mcsun!unido!kivax!koe > D-7730 VS-Villingen ..!uunet!unido!kivax!koe Hope this helps, -Eric -- Eric F. Johnson phone: +1 612 894 0313 BTI: Industrial Boulware Technologies, Inc. fax: +1 612 894 0316 automation systems 415 W. Travelers Trail email: erc@pai.mn.org and services Burnsville, MN 55337 USA