2 files changed, 5 insertions(+), 3 deletions(-)

M dryads-wake.w
M websocket.w
M dryads-wake.w +2 -0
@@ 604,6 604,8 @@ define : as-webserver
              . "rw"
         with-output-to-port p
             λ () : title-screen
+        ;; currently data sent via the websocket is returned
+        . data
     if : websocket-available?
         run-server handler
             make-server-socket #:port 8080

          
M websocket.w +3 -3
@@ 123,8 123,8 @@ called for each complete message that is
   (let* ((request (read-handshake-request client-socket))
          (client-key (assoc-ref (request-headers request) 'sec-websocket-key))
          (response (make-handshake-response client-key)))
-    (write-response response client-socket)
-    (if (not client-key)
+    (when (false-if-exception (write-response response client-socket))
+     (if (not client-key)
       (begin 
           (display static-response client-socket)
           (close client-socket))

          
@@ 161,7 161,7 @@ called for each complete message that is
             (loop (cons frame fragments) type))
            ((data-frame? frame) ; unfragmented data frame
             (handle-data-frame (frame-type frame) (frame-data frame))
-            (loop '() #f))))))))
+            (loop '() #f)))))))))
 
 
 define* : run-server handler #:optional (server-socket (make-server-socket))