X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;ds=sidebyside;f=demos%2Fwebsocket%2F8s-server.scm;h=5ea883494a29fab168d47c3fe4754b4128749046;hb=feb7f5104ddbcb9fd42b93d78f385804793ebb6c;hp=45e62bac9a1bfbfa451b55260bc819b8bd3d4129;hpb=ab7d0294d28fa686226e714a606c102e1f265a41;p=8sync.git diff --git a/demos/websocket/8s-server.scm b/demos/websocket/8s-server.scm index 45e62ba..5ea8834 100755 --- a/demos/websocket/8s-server.scm +++ b/demos/websocket/8s-server.scm @@ -42,26 +42,12 @@ (define (main . args) (let* ((hive (make-hive)) - (sleeper (bootstrap-actor hive )) + ;; (sleeper (bootstrap-actor hive )) (server (bootstrap-actor hive #:port %server-port - #:on-ws-connection - (lambda (ws) - (format (current-error-port) "on-ws-connection: ws=~s\n" ws) - (when #f - (set! (.on-close ws) - (lambda (ws) - (format (current-error-port) "on-close: ~s\n" ws))) - (set! (.on-error ws) - (lambda (ws e) - (format (current-error-port) "on-error: ~s, ~s\n" ws e))) - (set! (.on-message ws) - (lambda (ws msg) - (format (current-error-port) "on-message: ~s\n" msg))) - (set! (.on-open ws) - (lambda (ws) - (format (current-error-port) "on-open: ~s\n" ws))))) + #:on-ws-connection (lambda (ws) + (format (current-error-port) "on-ws-connection: ws=~s\n" ws)) #:on-ws-close (lambda (ws) (format (current-error-port) "on-close: ~s\n" ws)) #:on-ws-error (lambda (ws e) @@ -69,7 +55,11 @@ #:on-ws-message (lambda (ws msg) (format (current-error-port) "on-message: ~s: ~s\n" ws msg)) #:on-ws-open (lambda (ws) - (format (current-error-port) "on-open: ~s\n" ws))))) + (format (current-error-port) "on-open: ~s\n" ws) + (format (current-error-port) "sending: AAA...\n") + (<- (actor-id ws) 'send (make-string (* 1024 1024) #\A)) + (format (current-error-port) "sending: BBB...\n") + (<- (actor-id ws) 'send (make-string (* 1024 1024) #\B)))))) (format (current-error-port) "listening: ~s\n" %server-port) (run-hive hive '())))