summaryrefslogtreecommitdiff
path: root/ebus-racket/util
diff options
context:
space:
mode:
authorEbus-at-dockstar <ebus@dockstar>2013-04-30 17:49:26 +0200
committerEbus-at-dockstar <ebus@dockstar>2013-04-30 17:49:26 +0200
commit5e002f200691d5fd9c46ff645668b82e17c2261b (patch)
tree25f100549ac72fd1edf66c457b63aa43704e9c93 /ebus-racket/util
parent8810ba02335d60b2afda0a2d1efb101461dac891 (diff)
downloadebus-alt-5e002f200691d5fd9c46ff645668b82e17c2261b.tar.gz
ebus-alt-5e002f200691d5fd9c46ff645668b82e17c2261b.zip
ebus-racket: inserter adaption; remove tcp-repl
Diffstat (limited to 'ebus-racket/util')
-rw-r--r--ebus-racket/util/tcp-repl.rkt35
1 files changed, 0 insertions, 35 deletions
diff --git a/ebus-racket/util/tcp-repl.rkt b/ebus-racket/util/tcp-repl.rkt
deleted file mode 100644
index 4b19d85..0000000
--- a/ebus-racket/util/tcp-repl.rkt
+++ /dev/null
@@ -1,35 +0,0 @@
-(module tcp-repl racket/base
- (require mzlib/thread
- racket/tcp)
- (provide (prefix-out tcp-repl- run)
- (prefix-out tcp-repl- logger))
-
- (define logger (make-logger 'tcp-repl (current-logger)))
-
- (define (run namespace port)
- (thread
- (lambda ()
- (run-server port ; TCP-Port
- (make-connection-handler namespace) ; connection handler
- #f; timeout
- (lambda (tcp-port max-allow-wait reuse?) ; listen handler
- (log-message logger 'info (format "Listen on ~a:~a" "127.0.0.1" tcp-port) #t)
- (tcp-listen tcp-port max-allow-wait reuse? "127.0.0.1"))
- ))))
-
- (define (tcp-tostring port)
- (let-values ([(address-from port-from address-to port-to) (tcp-addresses port #t)])
- (format "~a:~a -> ~a:~a" address-from port-from address-to port-to)))
-
- (define (make-connection-handler namespace)
- (lambda (ip op)
- (let/ec exit
- (log-message logger 'info (format "New Connection ~a" (tcp-tostring ip)) #t)
- (parameterize ([current-input-port ip]
- [current-output-port op]
- [current-error-port op]
- [current-namespace namespace])
- (read-eval-print-loop))
- (log-message logger 'info (format "End Connection ~a" (tcp-tostring ip)) #t)
- (close-output-port op))))
- ) ; end module tcp-repl \ No newline at end of file