* Stephen Compall [2005-12-28 01:52+0100] writes:
On Thu, 2005-12-01 at 02:47 -0600, I wrote:
As far as I can tell, the only way a Swank connection object with style :fd-handler will ever be closed due to EOF (with close-connection) is if either the fd-handler implementation detects the EOF state and knows how to destroy Swank connections, or a condition is raised in the dynamic context of with-reader-error-handler. Looking at the topmost form in that context, however, it can only happen if (listen socket) answers T, so that the attempt to read can proceed and raise an eof-error, which gets wrapped up, etc.
I modified process-available-input to test (listen socket) only after calling FN at least once; after all, it always returns T when the handler is called for a normal input state. Without this patch, my fd-handler backend gets into an endless loop calling the handler in install-fd-handler (with the :eof state); with this patch, the socket is closed, removed from *connections*, and from the fd-handler backend properly.
Attached is the patch.
I thought maybe the DO loop was a bad idea, so here is a version that uses LOOP.
It's not the DO loop, it's because I can't reproduce the behavior. When I do a M-x slime-disconnect, everything seems to get closed just fine. Not that I can explain why open-stream-p in process-available-input returns true in that case, but apparently it does.
So, how to you actually produce the endless loop?