|
6 | 6 | web-server/http/request-structs
|
7 | 7 | net/rfc6455))
|
8 | 8 |
|
9 |
| -@title[#:version "2.0.0"]{RFC 6455 WebSockets for Racket} |
| 9 | +@title[#:version "2.1.0"]{RFC 6455 WebSockets for Racket} |
10 | 10 | @author[(author+email "Tony Garnock-Jones" "tonygarnockjones@gmail.com")]
|
11 | 11 |
|
12 | 12 | @;@local-table-of-contents[]
|
@@ -48,6 +48,10 @@ This package has been developed against
|
48 | 48 |
|
49 | 49 | @section{Changes}
|
50 | 50 |
|
| 51 | +Version 2.1.0 of this library introduces @racket[ws-conn-close-status] |
| 52 | +and @racket[ws-conn-close-reason] for retrieving information from |
| 53 | +close frames sent by remote peers. |
| 54 | + |
51 | 55 | Version 2.0.0 of this library introduces a new interface to streaming
|
52 | 56 | message reception, @racket[ws-recv-stream], and makes a breaking
|
53 | 57 | change to the way @racket[ws-conn?] values work as @(tech:event)s. The
|
@@ -173,6 +177,19 @@ Returns @racket[#t] if the given connection has been closed, and
|
173 | 177 |
|
174 | 178 | }
|
175 | 179 |
|
| 180 | +@deftogether[(@defproc[(ws-conn-close-status [c ws-conn?]) (or/c #f number?)] |
| 181 | + @defproc[(ws-conn-close-reason [c ws-conn?]) (or/c #f string?)])]{ |
| 182 | + |
| 183 | +When @racket[ws-conn-closed?] returns @racket[#t], these procedures |
| 184 | +will respectively retrieve the "status code" and "reason" text from |
| 185 | +the close frame sent by the remote peer that caused the connection |
| 186 | +shutdown. If no such information is available, they will return |
| 187 | +@racket[#f]. Only RFC 6455 peers send information in their close |
| 188 | +frames; hybi-00 connections will always yield @racket[#f] from these |
| 189 | +procedures. |
| 190 | + |
| 191 | +} |
| 192 | + |
176 | 193 | @defproc[(ws-connect [u (or/c ws-url? wss-url?)]
|
177 | 194 | [#:headers headers (listof header?) '()]
|
178 | 195 | [#:protocol protocol (or/c 'rfc6455 'hybi00) 'rfc6455])
|
|
0 commit comments