From: Christopher Allan Webber Date: Sat, 21 Jan 2017 00:15:59 +0000 (-0600) Subject: reply using new reply method X-Git-Tag: fosdem-2017~112 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=58fc6aec304928bf6080aa7988e870d85c4ade26;p=mudsync.git reply using new reply method --- diff --git a/mudsync/networking.scm b/mudsync/networking.scm index 1c28b38..e553e01 100644 --- a/mudsync/networking.scm +++ b/mudsync/networking.scm @@ -206,7 +206,7 @@ (pk 'web-server (create-actor nm #:port web-server-port #:http-handler (wrap-apply http-handler) - #:websocket-handler (wrap-apply websocket-handler))))) + #:on-ws-message (wrap-apply websocket-new-message))))) (define (view:main-display request body) (define one-entry @@ -271,7 +271,9 @@ ;; Respond to text messages by reversing the message. Respond to ;; binary messages with "hello". -(define (websocket-handler data) - (if (string? data) - (string-reverse data) - "hello")) +(define (websocket-new-message websocket-server client-id data) + (<- (actor-id websocket-server) 'ws-send + client-id + (if (string? data) + (string-reverse data) + "hello")))