From a0c60fd8dbe11b76758f326af0f4da602ab3e839 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Wed, 4 Jul 2012 17:15:11 -0400 Subject: [PATCH] Support three levels of interest-type for a topic: participant/ordinary, monitor/observer, and "super-monitor". --- new-server.rkt | 21 +++++---------------- ssh-session.rkt | 4 ---- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/new-server.rkt b/new-server.rkt index 9ea1080..d784a62 100644 --- a/new-server.rkt +++ b/new-server.rkt @@ -34,14 +34,7 @@ [(topic 'publisher (tcp-channel remote-addr (== server-addr) _) #f) (transition state (spawn (session-vm server-addr remote-addr) - #:debug-name (list 'ssh-session-vm remote-addr)))] - ;; PAPER NOTE: This second clause can be replaced with - ;; [_ state] for presentation economy - [(topic 'publisher (tcp-channel remote-addr (== server-addr) _) #t) - ;; Ignore monitor flows. They just mean there's - ;; someone willing to supply connections to us - ;; at some point in the future. - state])))) + #:debug-name (list 'ssh-session-vm remote-addr)))])))) ;;--------------------------------------------------------------------------- @@ -67,16 +60,12 @@ (flush-output) state]) (at-meta-level - (role 'channel-listener (topic-subscriber (channel-message (channel-stream-name #t (wild)) - (wild))) + (role 'channel-listener (topic-subscriber (channel-message (channel-stream-name #t (wild)) (wild))) #:state state #:topic t - #:on-presence - (if (topic-monitor? t) - state - (match t - [(topic _ (channel-message (channel-stream-name _ cname) _) _) - (transition state (spawn (repl-instance cname) #:debug-name cname))])))))) + #:on-presence (match t + [(topic _ (channel-message (channel-stream-name _ cname) _) _) + (transition state (spawn (repl-instance cname) #:debug-name cname))]))))) (define (repl-instance cname) (define inbound-stream (channel-stream-name #t cname)) diff --git a/ssh-session.rkt b/ssh-session.rkt index 8d63c0d..e880cb8 100644 --- a/ssh-session.rkt +++ b/ssh-session.rkt @@ -687,10 +687,6 @@ #:topic t #:on-presence (match t - [(topic _ _ #t) - ;; Monitor topics appearing indicate receptivity to incoming - ;; channels, and are nothing to do with outgoing channels. - conn] [(or (topic 'publisher (channel-message (channel-stream-name #f cname) _) #f) (topic 'subscriber (channel-message (channel-stream-name #t cname) _) #f)) (if (and (ground? cname)