summaryrefslogtreecommitdiff
path: root/web/socket/frame.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2015-12-01 23:01:04 -0500
committerDavid Thompson <dthompson2@worcester.edu>2015-12-02 13:30:14 -0500
commit4fc29ba8a26e0c04c94037ec77c778cb08dff29c (patch)
tree35464b9dc4f13691d9d57359d5ba046461e2e06a /web/socket/frame.scm
parentff2e65bf261fa788087142860f322c5bb317b32e (diff)
frame: Add make-ping-frame.
* web/socket/frame.scm (make-ping-frame): New procedure.
Diffstat (limited to 'web/socket/frame.scm')
-rw-r--r--web/socket/frame.scm15
1 files changed, 11 insertions, 4 deletions
diff --git a/web/socket/frame.scm b/web/socket/frame.scm
index 3bd56f7..0b358ae 100644
--- a/web/socket/frame.scm
+++ b/web/socket/frame.scm
@@ -40,6 +40,7 @@
frame-masking-key
frame-data
+ make-ping-frame
make-pong-frame
make-close-frame
make-text-frame
@@ -86,24 +87,30 @@
(set-record-type-printer! <frame> display-frame)
-(define* (make-pong-frame bv #:optional (masking-key #f))
+(define* (make-ping-frame bv #:optional masking-key)
+ "Return a \"ping\" control frame containing the contents of the
+bytevector BV, masked with MASKING-KEY. By default, the data is
+unmasked."
+ (make-frame #t 'ping masking-key bv))
+
+(define* (make-pong-frame bv #:optional masking-key)
"Return a \"pong\" control frame containing the contents of the
bytevector BV, masked with MASKING-KEY. By default, the data is
unmasked."
(make-frame #t 'pong masking-key bv))
-(define* (make-close-frame bv #:optional (masking-key #f))
+(define* (make-close-frame bv #:optional masking-key)
"Return a \"close\" control frame containing the contents of the
bytevector BV, masked with MASKING-KEY. By default, the data is
unmasked."
(make-frame #t 'close masking-key bv))
-(define* (make-text-frame text #:optional (masking-key #f))
+(define* (make-text-frame text #:optional masking-key)
"Return a text data frame containing the string TEXT, masked with MASKING-KEY.
By default, the text is unmasked."
(make-frame #t 'text masking-key (string->utf8 text)))
-(define* (make-binary-frame bv #:optional (masking-key #f))
+(define* (make-binary-frame bv #:optional masking-key)
"Return a binary data frame containing the contents of the
bytevector BV, masked with MASKING-KEY. By default, the data is
unmasked."