Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!bu.edu!att!linac!midway!mimsy!mojo!eng.umd.edu!stripes From: stripes@eng.umd.edu (Joshua Osborne) Newsgroups: comp.windows.x Subject: Re: Design problem with XSetIOErrorHandler Message-ID: <1991Jan24.010427.29654@eng.umd.edu> Date: 24 Jan 91 01:04:27 GMT References: <2959@laura.UUCP> Sender: news@eng.umd.edu (C-News) Reply-To: stripes@eng.umd.edu (Joshua Osborne) Organization: College of Engineering, Maryversity of Uniland, College Park Lines: 30 In article <2959@laura.UUCP>, klute@tommy.informatik.uni-dortmund.de (Rainer Klute) writes: > May I cite from the Xlib MIT X Consortium Standard on XSetIOErrorHandler: > > "The XSetIOErrorHandler sets the fatal I/O error handler. > Xlib calls the program's supplied error handler if any sort > of system call error occurs (for example, the connection to > the server was lost). This is assumed to be a fatal condition, > and the called routine should not return. If the I/O error > handler does return, the client process exits." > > I wonder why the Standard considers I/O errors "fatal" and the why the X > client has no other chance than to quit execution. > > The application I am writing wants to deal with I/O errors itself - and in > quite another way than exiting. Especially the example quoted from the > Standard (connection to server lost) is the problem I want to handle. My > application opens connections to several servers, and if one of them breaks > the program is still able to operate. So why should it exit? I had this problem in a multi-player game (xtrek, havn't fixed xtank yet) under X11R3. Using longjmp() worked Ok. I checked all the displays, when I found the one that had closed I re-opened a connection and displayed a message ("Please don't kill xtrek, just Self Destruct"). It was kind of a pain & using WM_DELETE is much nicer, I'm glad the ICCCM gave a thought to it... -- stripes@eng.umd.edu "Security for Unix is like Josh_Osborne@Real_World,The Multitasking for MS-DOS" "The dyslexic porgramer" - Kevin Lockwood "CNN is the only nuclear capable news network..." - lbruck@eng.umd.edu (Lewis Bruck)