Broken Pipe

I have a couple somewhat related questions. I have a remote display. At that remote display (X server) my application can be killed, or the connection to the server can be dropped (Ethernet cable cut). Here are my questions:

1) If my application is killed, I see broken pipe error on my display local terminal, and my application exits. Is there anyway to intercept this in my X-Windows / Motif code so I can exit gracefully (close files, etc).

2) If the Ethernet cable is disconnected from between the Server and Client, is there anyway in X / Motif I can determine this? Right now, the client application doesn't exit.

Thanks,


Andriy Konoval

Andriy Konoval's picture

Broken Pipe

1) you can set custom X Error handler to handle network issues (look at XSetErrorhandler())
2) X determines it if any network transfer occurs