Merge from 0.6: handler for bind-listen-accept-loop, which closes the socket.

This commit is contained in:
mainzelm 2001-07-10 11:49:06 +00:00
parent 0fb3d6da8e
commit 9c560cf537
1 changed files with 17 additions and 3 deletions

View File

@ -80,9 +80,23 @@
(set-socket-option sock level/socket socket/reuse-address #t)
(bind-socket sock addr)
(listen-socket sock 5)
(let loop ()
(call-with-values (lambda () (accept-connection sock)) proc)
(loop))))
(with-handler
(lambda (condition more)
(with-handler
(lambda (condition ignore) (more))
(lambda () (close-socket sock)))
(more))
(lambda ()
(let loop ()
(with-errno-handler
;; ECONNABORTED we just ignore
((errno packet)
((errno/connaborted) (loop)))
(call-with-values
(lambda () (accept-connection sock))
proc)
(loop)))))))
;;;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
;;; Socket Record Structure