Cleaning make-connection call
svn: r647
This commit is contained in:
parent
a817635bb6
commit
8a9da56f23
|
@ -26,17 +26,13 @@
|
||||||
;; new-connection: number i-port o-port custodian -> connection
|
;; new-connection: number i-port o-port custodian -> connection
|
||||||
;; ask the connection manager for a new connection
|
;; ask the connection manager for a new connection
|
||||||
(define (new-connection time-to-live i-port o-port cust close?)
|
(define (new-connection time-to-live i-port o-port cust close?)
|
||||||
(let ([mutex (make-semaphore 1)])
|
(letrec ([conn
|
||||||
(make-connection
|
(make-connection
|
||||||
(start-timer time-to-live
|
(start-timer time-to-live
|
||||||
(lambda ()
|
(lambda () (kill-connection! conn)))
|
||||||
(call-with-semaphore
|
i-port o-port cust close?
|
||||||
mutex
|
(make-semaphore 1))])
|
||||||
(lambda ()
|
conn))
|
||||||
(close-output-port o-port)
|
|
||||||
(close-input-port i-port)
|
|
||||||
(custodian-shutdown-all cust)))))
|
|
||||||
i-port o-port cust close? mutex)))
|
|
||||||
|
|
||||||
;; kill-connection!: connection -> void
|
;; kill-connection!: connection -> void
|
||||||
;; kill this connection
|
;; kill this connection
|
||||||
|
@ -46,6 +42,7 @@
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(close-output-port (connection-o-port conn-demned))
|
(close-output-port (connection-o-port conn-demned))
|
||||||
(close-input-port (connection-i-port conn-demned))
|
(close-input-port (connection-i-port conn-demned))
|
||||||
|
(set-connection-close?! conn-demned #t)
|
||||||
(custodian-shutdown-all (connection-custodian conn-demned)))))
|
(custodian-shutdown-all (connection-custodian conn-demned)))))
|
||||||
|
|
||||||
;; adjust-connection-timeout!: connection number -> void
|
;; adjust-connection-timeout!: connection number -> void
|
||||||
|
|
Loading…
Reference in New Issue
Block a user