Added bind-prepare-listen-accept-loop.

This commit is contained in:
mainzelm 2003-02-20 17:18:56 +00:00
parent 673dbaffdb
commit da76638c82
2 changed files with 11 additions and 0 deletions

View File

@ -48,6 +48,9 @@
#f))))
(define (bind-listen-accept-loop protocol-family proc arg)
(bind-prepare-listen-accept-loop protocol-family (lambda () #t) proc arg))
(define (bind-prepare-listen-accept-loop protocol-family prepare proc arg)
(let* ((sock (create-socket protocol-family socket-type/stream))
(addr (cond ((= protocol-family
protocol-family/internet)
@ -68,6 +71,13 @@
protocol-family)))))
(set-socket-option sock level/socket socket/reuse-address #t)
(bind-socket sock addr)
(with-handler
(lambda (condition more)
(with-handler
(lambda (condition ignore) (more))
(lambda () (close-socket sock)))
(more))
prepare)
(listen-socket sock 5)
(with-handler
(lambda (condition more)

View File

@ -695,6 +695,7 @@
(define-interface scsh-sockets-interface
(export socket-connect
bind-listen-accept-loop
bind-prepare-listen-accept-loop
socket?
socket:family
socket:inport