Merge from 0.6: handler for bind-listen-accept-loop, which closes the socket.
This commit is contained in:
parent
0fb3d6da8e
commit
9c560cf537
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue