Synchronizable events from Tom McNulty

This commit is contained in:
Jay McCarthy 2011-12-26 14:33:07 -07:00
parent ddcab952f7
commit ae31b19168
2 changed files with 4 additions and 1 deletions

View File

@ -74,6 +74,8 @@ This module also provides the exports from @racketmodname[net/websocket/conn].
@defmodule[net/websocket/conn]
WebSocket connection are synchronizable events.
@defparam[framing-mode mode (symbols 'old 'new)]{ Controls whether framing is as before August 16th, 2010 or after. (Most Web browsers currently support only @racket['old] and they are incompatible, so you must choose the correct one.) Defaults to @racket['old].}
@defproc[(ws-conn? [x any/c]) boolean?]{ Returns true if @racket[x] is a WebSocket connection. }

View File

@ -3,7 +3,8 @@
(define framing-mode (make-parameter 'old))
(struct ws-conn ([closed? #:mutable] line headers ip op))
(struct ws-conn ([closed? #:mutable] line headers ip op)
#:property prop:evt (struct-field-index ip))
(define (open-ws-conn? x)
(and (ws-conn? x) (not (ws-conn-closed? x))))
(provide/contract