mirror of
https://github.com/rabbibotton/clog.git
synced 2025-12-06 02:30:42 -08:00
Source reorg.
This commit is contained in:
parent
d7ae4c1bfd
commit
f64bc7df44
5 changed files with 307 additions and 226 deletions
31
test/test-clog-connection.lisp
Normal file
31
test/test-clog-connection.lisp
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
(defpackage #:test-clog-connection
|
||||
(:use #:cl)
|
||||
(:export test on-connect))
|
||||
|
||||
(in-package :test-clog-connection)
|
||||
|
||||
(defun on-connect (id)
|
||||
(format t "Connection ~A is valid? ~A~%" id (clog-connection:validp id))
|
||||
(dotimes (n 10)
|
||||
(clog-connection:put id "<b>connection-write</b>")
|
||||
(clog-connection:put-line id "<i>connection-writeln</i>")
|
||||
(sleep .2))
|
||||
(clog-connection:put id "<br><b>Query Result : </b>")
|
||||
(clog-connection:put-line id (clog-connection:query id "navigator.appVersion"))
|
||||
(clog-connection:new-line id)
|
||||
(clog-connection:put id "<hr>simulate network interupt")
|
||||
(clog-connection:cclose id)
|
||||
(sleep .2)
|
||||
(clog-connection:put id "<br><b>reconnected</b>")
|
||||
(sleep .2)
|
||||
(clog-connection:put id "<br><b>shutting down connection</b>")
|
||||
(sleep .2)
|
||||
;; It is generally uneccessary to shutdown the connection
|
||||
(clog-connection:shutdown id))
|
||||
|
||||
(defun test ()
|
||||
(print "Init connection")
|
||||
(clog:initialize #'on-connect :boot-file "/debug.html")
|
||||
(print "Open browser")
|
||||
(clog:open-browser)
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue