Kick> And as soon as the remote end closes, the descriptor remains readable
Kick> (for EOF, I suppose) and so the handler gets called again and again,
Kick> "unsticking it."
SYS:INVALIDATE-DESCRIPTOR is your friend...
BTW: code/serve-event.lisp has commented out the form that's supposed
to protect us from recursively calling a handler eg after an
error. I'd put it back in again, and also fix a buglet that I think
affects the return value from SYS:SERVE-EVENT.
Ole
@@ -426,17 +201,16 @@
(:input (unix:fd-isset desc read-fds))
(:output (unix:fd-isset desc write-fds)))
(unwind-protect
(progn
- ;; Doesn't work -- ACK
- ;(setf (handler-active handler) t)
+ (setf (handler-active handler) t)
(funcall (handler-function handler) desc))
(setf (handler-active handler) nil))
(ecase (handler-direction handler)
(:input (unix:fd-clr desc read-fds))
(:output (unix:fd-clr desc write-fds)))
- (setf result t)))
- result)))
+ (setf result t))))
+ result))