make SSL listeners events

This commit is contained in:
Matthew Flatt 2010-11-17 13:15:59 -07:00
parent 99e66e0dea
commit 421519994d
2 changed files with 12 additions and 4 deletions

View File

@ -270,7 +270,9 @@
(define-struct (ssl-client-context ssl-context) ())
(define-struct (ssl-server-context ssl-context) ())
(define-struct ssl-listener (l mzctx))
(define-struct ssl-listener (l mzctx)
#:property prop:evt (lambda (lst) (wrap-evt (ssl-listener-l lst)
(lambda (x) lst))))
;; internal:
(define-struct mzssl (ssl i o r-bio w-bio pipe-r pipe-w

View File

@ -139,8 +139,7 @@ Returns @scheme[#t] if @scheme[v] is a value produced by
(or/c ssl-server-context? symbol?) 'sslv2-or-v3])
ssl-listener?]{
Like @scheme[tcp-listen], but the result is an SSL listener (which is
a synchronizable value; see @scheme[sync]). The extra optional
Like @scheme[tcp-listen], but the result is an SSL listener. The extra optional
@scheme[server-protocol] is as for @scheme[ssl-connect], except that a
context must be a server context instead of a client context.
@ -149,7 +148,14 @@ Call @scheme[ssl-load-certificate-chain!] and
error on accepting connections. The file @filepath{test.pem} in the
@filepath{openssl} collection is a suitable argument for both calls
when testing. Since @filepath{test.pem} is public, however, such a
test configuration obviously provides no security.}
test configuration obviously provides no security.
An SSL listener is a synchronizable value (see @scheme[sync]). It is
ready---with itself as its value---when the underlying TCP listener is
ready. At that point, however, accepting a connection with
@racket[ssl-accept] may not complete immediately, because
further communication is needed to establish the connection.}
@deftogether[(
@defproc[(ssl-close (listener ssl-listener?)) void?]