IO error catching



Hello All,

Is there a way to return from the main loop in case of a "fatal"
IO error (for example the X-Server died). And after that return
being able to (try) reconnect to the X-Server again. I am thinking about
and application where there are two computers, one with the programm
that 
always runs, and one with the X-Server that doesn't always runs. Both
computers are connected via cross over with known IP numbers. The one
with the X-Server has just the X-Server and nothing else as it is turned
on it starts the X-Server, nothing else. The programm runnign on the
other
computer detects the X-Server and connects. When the computer with
the X-Server is turned off, the programm on the other computer should
not die
but keep running and keep retrying to connect to the X-Server. 

I though somethign like a longjmp from the error handler to the mainloop
and
exit from the loop. The main problem is probably clean up without
getting into
a endless error loop, or having memory leaks. 

Any hints, "you are an idiot" msgs, or quiestions are welcome,

Erwin




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]