[in.xpert] How to deal with KillClient request?

yus@ul.ie (03/13/91)

I write a X program using Xlib to open two displays:
Display1 on a local workstation for controlling
something and Display2 on a remote workstation for
monitoring the window information from Display1.
That means the program draws the same information
in windows on the two workstations.
My problem is:
When the Window Manager on the remote workstation
uses 'cancel' or 'kill' item to kill the window, it
causes Window Manager to send a KillClient request
to the server, then the server disconnects the display2.
My program doesn't know that the connection has been closed,
and it keeps drawing information in remote window.
So, the program crushed dwon.
Could you tell me how can my program get informed or
how can my program fetch a connection-closed message
from somewhere when the window was killed by the KillClient request?
My e-mail address is : yus@ul.ie

Please response to me if you know how to do it.
Shank you

Shousan Yu
Dept. of ECE
Univ. of Limerick
Ireland