Index: rmtmod.scm ================================================================== --- rmtmod.scm +++ rmtmod.scm @@ -1642,11 +1642,11 @@ (if (and *db-serv-info* (servdat-uconn *db-serv-info*)) (let* ((uconn (servdat-uconn *db-serv-info*))) (wait-and-close uconn)) (let* ((port (portlogger:open-run-close portlogger:find-port)) - (handler-proc (lambda (rem-host-port qrykey cmd params) ;; + (handler-proc (lambda (rem-host-port cmd params) ;; (set! *db-last-access* (current-seconds)) (assert (list? params) "FATAL: handler called with non-list params") (assert (args:get-arg "-server") "FATAL: handler called on non-server side. cmd="cmd", params="params) (debug:print 0 *default-log-port* "handler call: "cmd", params="params) (api:execute-requests *dbstruct-db* cmd params)))) Index: ulex-simple/ulex.scm ================================================================== --- ulex-simple/ulex.scm +++ ulex-simple/ulex.scm @@ -104,26 +104,10 @@ (cmd-thread #f) (work-queue-thread #f) (num-threads-running 0) ) -;; ;; struct for keeping track of others we are talking to -;; ;; -;; (defstruct pdat -;; (host-port #f) -;; (conns '()) ;; list of pcon structs, pop one off when calling the peer -;; ) -;; -;; ;; struct for peer connections, keep track of expiration etc. -;; ;; -;; (defstruct pcon -;; (inp #f) -;; (oup #f) -;; (exp (+ (current-seconds) 59)) ;; expires at this time, set to (+ (current-seconds) 59) -;; (lifetime (+ (current-seconds) 600)) ;; throw away and create new after five minutes -;; ) - ;;====================================================================== ;; listener ;;====================================================================== ;; is uconn a ulex connector (listener) @@ -198,22 +182,22 @@ ;; ;; NOTE: see below for beginnings of code to allow re-use of tcp connections ;; - I believe (without substantial evidence) that re-using connections will ;; be beneficial ... ;; -(define (send udata host-port qrykey cmd params) +(define (send-receive udata host-port cmd params) (mutex-lock! *send-mutex*) (let* ((my-host-port (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)) + (dat (list my-host-port cmd params)) (parts (string-split host-port ":")) (host (car parts)) (port (string->number (cadr parts)))) (if isme (ulex-handler udata dat) ;; no transmission needed - (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) (deserialize inp)) ;; yes, we always want an ack (begin @@ -222,16 +206,10 @@ (close-input-port inp) (close-output-port oup) (mutex-unlock! *send-mutex*) res))))) -;; send a request to the given host-port and register a mailbox in udata -;; wait for the mailbox data and return it -;; -(define (send-receive uconn host-port cmd data) - (send uconn host-port 'qrykey cmd data)) - ;;====================================================================== ;; responder side ;;====================================================================== ;; take a request, rdat, and if not immediate put it in the work queue @@ -239,11 +217,11 @@ ;; Reserved cmds; ack ping goodbye response ;; (define (ulex-handler uconn rdat) (assert (list? rdat) "FATAL: ulex-handler give rdat as not list") (match rdat - ((rem-host-port qrykey cmd params) + ((rem-host-port cmd params) (do-work uconn rdat)) (else (print "BAD DATA? controldat=" rdat) 'bad-data) )) @@ -303,13 +281,13 @@ (define (do-work uconn rdat) (let* ((proc (udat-work-proc uconn))) ;; get it each time - conceivebly it could change ;; put this following into a do-work procedure (match rdat - ((rem-host-port qrykey cmd params) + ((rem-host-port cmd params) (let* ((start-time (current-milliseconds)) - (result (proc rem-host-port qrykey cmd params)) + (result (proc rem-host-port 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")