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)
|
(set-socket-option sock level/socket socket/reuse-address #t)
|
||||||
(bind-socket sock addr)
|
(bind-socket sock addr)
|
||||||
(listen-socket sock 5)
|
(listen-socket sock 5)
|
||||||
|
(with-handler
|
||||||
|
(lambda (condition more)
|
||||||
|
(with-handler
|
||||||
|
(lambda (condition ignore) (more))
|
||||||
|
(lambda () (close-socket sock)))
|
||||||
|
(more))
|
||||||
|
(lambda ()
|
||||||
(let loop ()
|
(let loop ()
|
||||||
(call-with-values (lambda () (accept-connection sock)) proc)
|
(with-errno-handler
|
||||||
(loop))))
|
;; ECONNABORTED we just ignore
|
||||||
|
((errno packet)
|
||||||
|
((errno/connaborted) (loop)))
|
||||||
|
(call-with-values
|
||||||
|
(lambda () (accept-connection sock))
|
||||||
|
proc)
|
||||||
|
(loop)))))))
|
||||||
|
|
||||||
|
|
||||||
;;;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
;;;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
||||||
;;; Socket Record Structure
|
;;; Socket Record Structure
|
||||||
|
|
Loading…
Reference in New Issue