Made start and stop scripts to replace run.

Pascal J. Bourguignon [2021-05-23 08:05]
Made start and stop scripts to replace run.
Filename
clext/telnet/start.lisp
clext/telnet/stop.lisp
diff --git a/clext/telnet/start.lisp b/clext/telnet/start.lisp
new file mode 100644
index 0000000..d0f0b25
--- /dev/null
+++ b/clext/telnet/start.lisp
@@ -0,0 +1,99 @@
+(push :debug-condition-variables *features*)
+;; (push :debug-trace-telnet *features*)
+
+(ql:quickload :com.informatimago.clext.telnet.repl.test)
+
+
+(in-package "COM.INFORMATIMAGO.CLEXT.TELNET.STREAM")
+#+debug-trace-telnet
+(trace %input-buffer-free-space
+       %input-buffer-length
+       %input-buffer-ranges
+       %stream-read-char
+       %wait-for-input-data-present
+       %wait-for-input-free-space
+       (setf stream-echo-mode)
+       (setf stream-element-type)
+       (setf stream-external-format)
+       (setf stream-input-buffering)
+       (setf stream-output-buffering)
+       buffer-append
+       call-with-telnet-on-stream
+       check-sequence-arguments
+       check-stream-open
+       configure-mode
+       encode-string-to-output-buffer
+       flush-output-buffer
+       input-buffer-append-octet
+       input-buffer-append-octets
+       input-buffer-append-text
+       input-buffer-erase-character
+       input-buffer-erase-line
+       input-buffer-fetch-octet
+       input-buffer-peek-octet
+       input-buffer-read-octet
+       input-loop
+       make-binary-buffer
+       make-input-buffer
+       make-string-buffer
+       receive-binary
+       receive-control
+       receive-option
+       receive-text
+       send
+       send-binary
+       send-control
+       send-text
+
+       type-equal-p
+       update-column
+       want-option-p)
+
+
+#+debug-trace-telnet
+(trace (stream-read-char         :if (typep (first ccl::args) 'telnet-stream))
+       (stream-read-char-no-hang :if (typep (first ccl::args) 'telnet-stream))
+       (stream-peek-char         :if (typep (first ccl::args) 'telnet-stream))
+       (stream-read-line         :if (typep (first ccl::args) 'telnet-stream))
+       (stream-listen            :if (typep (first ccl::args) 'telnet-stream))
+       (stream-unread-char       :if (typep (first ccl::args) 'telnet-stream))
+       (stream-read-byte         :if (typep (first ccl::args) 'telnet-stream))
+       (stream-read-sequence     :if (typep (first ccl::args) 'telnet-stream))
+       (stream-advance-to-column :if (typep (first ccl::args) 'telnet-stream))
+       (stream-finish-output     :if (typep (first ccl::args) 'telnet-stream))
+       (stream-line-column       :if (typep (first ccl::args) 'telnet-stream))
+       (stream-start-line-p      :if (typep (first ccl::args) 'telnet-stream))
+       (stream-terpri            :if (typep (first ccl::args) 'telnet-stream))
+       (stream-write-byte        :if (typep (first ccl::args) 'telnet-stream))
+       (stream-write-char        :if (typep (first ccl::args) 'telnet-stream))
+       (stream-write-sequence    :if (typep (first ccl::args) 'telnet-stream))
+       (stream-write-string      :if (typep (first ccl::args) 'telnet-stream)))
+
+
+
+(in-package "COM.INFORMATIMAGO.CLEXT.TELNET.REPL")
+#+debug-trace-telnet
+(trace make-repl-readtable
+       make-repl-package
+       telnet-repl
+       run-client-loop
+       %clean-up
+       %add-client
+       remove-client
+       wait-for-free-client-slot
+       run-server-loop
+       start-repl-server
+       stop-repl-server)
+
+
+
+(in-package "COM.INFORMATIMAGO.CLEXT.TELNET.REPL")
+
+(defparameter *repl-server* (com.informatimago.clext.telnet.repl:start-repl-server
+                                   :banner-function (lambda (stream cn name)
+                                                      (format stream "~&REPL SERVER #~A ~A~%" cn name)
+                                                      (force-output stream))
+                                   :login-function nil))
+
+(com.informatimago.tools.thread:list-threads)
+
diff --git a/clext/telnet/stop.lisp b/clext/telnet/stop.lisp
new file mode 100644
index 0000000..dc1119b
--- /dev/null
+++ b/clext/telnet/stop.lisp
@@ -0,0 +1,3 @@
+(in-package "COM.INFORMATIMAGO.CLEXT.TELNET.REPL")
+(setf *repl-server* (com.informatimago.clext.telnet.repl:stop-repl-server *repl-server*))
+(com.informatimago.tools.thread:list-threads)
ViewGit