ADDED tests/simplerun/simple.scm Index: tests/simplerun/simple.scm ================================================================== --- /dev/null +++ tests/simplerun/simple.scm @@ -0,0 +1,2 @@ +(rmt:get-keys) + Index: ulex-simple/dbmgr.scm ================================================================== --- ulex-simple/dbmgr.scm +++ ulex-simple/dbmgr.scm @@ -700,11 +700,11 @@ (thread-sleep! 0.2) (exit))) sdat)) (begin ;; sdat not yet contains server info (debug:print-info 0 *default-log-port* "Still waiting, last-sdat=" last-sdat) - (sleep 4) + (thread-sleep! 4) (if (> (- (current-seconds) start-time) 120) ;; been waiting for two minutes (begin (debug:print-error 0 *default-log-port* "transport appears to have died, exiting server") (exit)) (loop start-time Index: ulex-simple/ulex.scm ================================================================== --- ulex-simple/ulex.scm +++ ulex-simple/ulex.scm @@ -176,11 +176,14 @@ ;; ;; retval tells send to expect and wait for return data (one line) and return it or time out ;; this is for ping where we don't want to necessarily have set up our own server yet. ;; (define (send-receive udata host-port cmd params) - (let* ((my-host-port (udat-host-port udata)) ;; remote will return to this + (let* ((host-port-lst (string-split host-port ":")) + (host (car host-port-lst)) + (port (string->number (cadr host-port-lst))) + (my-host-port (and udata (udat-host-port udata))) ;; remote will return to this (isme (equal? host-port my-host-port)) ;; calling myself? ;; dat is a self-contained work block that can be sent or handled locally (dat (list my-host-port 'qrykey cmd params #;(cons (current-seconds)(current-milliseconds))))) (cond (isme (do-work udata dat)) ;; no transmission needed @@ -188,11 +191,11 @@ (handle-exceptions ;; TODO - MAKE THIS EXCEPTION CMD SPECIFIC? exn (message exn) (begin ;; (mutex-lock! *send-mutex*) ;; DOESN'T SEEM TO HELP - (let-values (((inp oup)(tcp-connect host-port))) + (let-values (((inp oup)(tcp-connect host port))) (let ((res (if (and inp oup) (begin (serialize dat oup) (close-output-port oup) (deserialize inp)) @@ -208,19 +211,23 @@ ;;====================================================================== ;; move the logic to return the result somewhere else? ;; (define (do-work uconn rdat) - (let* ((proc (udat-work-proc uconn))) ;; get it each time - conceivebly it could change + (let* () ;; get it each time - conceivebly it could change ;; put this following into a do-work procedure (match rdat ((rem-host-port qrykey cmd params) - (let* ((start-time (current-milliseconds)) - (result (proc rem-host-port qrykey cmd params)) - (end-time (current-milliseconds)) - (run-time (- end-time start-time))) - result)) + (case cmd + ((ping) #t) ;; bypass calling the proc + (else + (let* ((proc (udat-work-proc uconn)) + (start-time (current-milliseconds)) + (result (proc rem-host-port qrykey cmd params)) + (end-time (current-milliseconds)) + (run-time (- end-time start-time))) + result)))) (else (print "ERROR: rdat "rdat", did not match rem-host-port qrykey cmd params"))))) ;;====================================================================== ;; misc utils