Subject: [clisp-list] exception handling

From: "Fuliang Weng (RTC)" <[email-masked]>
Date: Thu Oct 17 15:52:06 2002

Hello all,

I am looking for any info regarding exception handling in clisp.

The problem is like this: I have two programs running on two sides 
(server and client) of a socket. When the server crashes, any attempt by 
the client to send or receive a message would lead to the client's 
crash. I would like to have a solution so that the client can detect the 
crash of the server, and wait for its recovery instead of simple crash 
and restart.

Please let me know if you have any good solution to this. Thank you very 
much.

--Fuliang

---

From: Kaz Kylheku <[email-masked]>
Date: Thu Oct 17 16:07:10 2002

On Thu, 17 Oct 2002, Fuliang Weng (RTC) wrote:

> crash.

Huh? Maybe the client is dying due to an unhandled SIGPIPE after
writing on the socket?

> I would like to have a solution so that the client can detect the 

If you can turn the socket error into a condition, then you have the
condition handling system in Lisp at your disposal. The code
surrounding the socket operation has the expertise on how to reconnect
to the server, or on how to recover itself if that is not wanted.
To choose the course of action, it can provide restarts for all of them
and signal an error, to get advice from higher level code.

Read about restart-case, handler-bind, invoke-restart, error,
define-condition, signal and friends.