Index: megatest.scm ================================================================== --- megatest.scm +++ megatest.scm @@ -733,23 +733,22 @@ ;; Start the server - can be done in conjunction with -runall or -runtests (one day...) ;; we start the server if not running else start the client thread ;;====================================================================== (if (args:get-arg "-server") - + ;; Server? Start up here. ;; - (let ((tl (launch:setup)) - (run-id (and (args:get-arg "-run-id") - (string->number (args:get-arg "-run-id")))) - (transport-type (string->symbol (or (args:get-arg "-transport") "http")))) + (let* ((tl (launch:setup)) + (run-id (and (args:get-arg "-run-id") + (string->number (args:get-arg "-run-id"))))) (if run-id - (begin - (server:launch run-id transport-type) + (begin + (server:launch run-id (->string *transport-type*)) (set! *didsomething* #t)) (debug:print-error 0 *default-log-port* "server requires run-id be specified with -run-id"))) - + ;; Not a server? This section will decide how to communicate ;; ;; Setup client for all expect listed here (if (null? (lset-intersection equal? Index: rmt.scm ================================================================== --- rmt.scm +++ rmt.scm @@ -144,10 +144,11 @@ ;; no success... (begin ;; let ((new-connection-info (client:setup run-id))) (debug:print 0 *default-log-port* "WARNING: Communication failed, trying call to rmt:send-receive again.") (case transport-type + ((http rpc) (hash-table-delete! *runremote* run-id) ;; don't keep using the same connection ;; NOTE: killing server causes this process to block forever. No idea why. Dec 2. ;; (if (eq? (modulo attemptnum 5) 0) ;; (tasks:kill-server-run-id run-id tag: "api-send-receive-failed")) Index: server.scm ================================================================== --- server.scm +++ server.scm @@ -49,17 +49,18 @@ ;; ;; start_server ;; (define (server:launch run-id transport-type) (BB> "server:launch fired for run-id="run-id" transport-type="transport-type) - (case transport-type - ((http)(http-transport:launch run-id)) - ;;((nmsg)(nmsg-transport:launch run-id)) - ((rpc) (rpc-transport:launch run-id)) - (else (debug:print-error 0 *default-log-port* "unknown server type " transport-type)))) -;; (else (debug:print-error 0 *default-log-port* "No known transport set, transport=" transport ", using rpc") -;; (rpc-transport:launch run-id))))) + (let ((ttype (if (symbol? transport-type) transport-type (string->symbol (->string transport-type))))) + (case ttype + ((http)(http-transport:launch run-id)) + ;;((nmsg)(nmsg-transport:launch run-id)) + ((rpc) (rpc-transport:launch run-id)) + (else (debug:print-error 0 *default-log-port* "unknown server type " ttype))))) + ;; (else (debug:print-error 0 *default-log-port* "No known transport set, transport=" transport ", using rpc") + ;; (rpc-transport:launch run-id))))) ;;====================================================================== ;; S E R V E R U T I L I T I E S ;;====================================================================== @@ -67,11 +68,12 @@ ;; called by launch:setup (define (server:set-transport) (let ((ttype (string->symbol (or (args:get-arg "-transport") (configf:lookup *configdat* "server" "transport") - "http")))) + "rpc")))) + (BB> "TRANSPORT IS "ttype" string?"(string? ttype)" symbol?"(symbol? ttype)) (set! *transport-type* ttype) ttype)) ;; Get the transport -- DO NOT call this from client code. In client code, this is run-id sensitive and not a global ;; For code communicating with existing run-id with a server, use: (rmt:run-id->transport-type run-id)