From ae31b191689f2da0be6607adb8dffb7ab825bbd5 Mon Sep 17 00:00:00 2001 From: Jay McCarthy Date: Mon, 26 Dec 2011 14:33:07 -0700 Subject: [PATCH] Synchronizable events from Tom McNulty --- collects/net/scribblings/websocket.scrbl | 2 ++ collects/net/websocket/conn.rkt | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/collects/net/scribblings/websocket.scrbl b/collects/net/scribblings/websocket.scrbl index 825f7742fd..d55cbbd762 100644 --- a/collects/net/scribblings/websocket.scrbl +++ b/collects/net/scribblings/websocket.scrbl @@ -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. } diff --git a/collects/net/websocket/conn.rkt b/collects/net/websocket/conn.rkt index ca18d03731..46606fcd16 100644 --- a/collects/net/websocket/conn.rkt +++ b/collects/net/websocket/conn.rkt @@ -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