From c6753ed8974da8090037a52d65415143ebf1c015 Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Mon, 5 Mar 2012 22:27:22 +0100 Subject: ebus-racket: tcp repl (--tcp-repl ) --- ebus-racket/net-repl.rkt | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 ebus-racket/net-repl.rkt (limited to 'ebus-racket/net-repl.rkt') diff --git a/ebus-racket/net-repl.rkt b/ebus-racket/net-repl.rkt deleted file mode 100644 index 1d53807..0000000 --- a/ebus-racket/net-repl.rkt +++ /dev/null @@ -1,34 +0,0 @@ -#lang racket -(require mzlib/thread) -(require "db.rkt") - -(define-namespace-anchor a) -(define ns (namespace-anchor->namespace a)) - -(define (my-eval expr) - (eval expr ns)) - - -(define (run-tcp-repl namespace port) - (thread - (lambda () - (run-server port - net-repl-connection - #f - (lambda (port-k max-allow-wait reuse?) - (tcp-listen port-k max-allow-wait reuse? "127.0.0.1")) - )))) - - (define (net-repl-connection i o) - (let/ec exit - (parameterize ([current-input-port i] - [current-output-port o] - [current-error-port o] - [current-namespace ns]) - (read-eval-print-loop)) - (fprintf o "\nBye...\n") - (close-output-port o))) - - -(define-namespace-anchor ns-anchor) -(thread-wait (run-tcp-repl (namespace-anchor->namespace ns-anchor) 8890)) -- cgit v1.2.1