264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
|
(thread-terminate! th2)
(debug:print-info 11 "got res=" res)
res)))))
;;
;; connect
;;
(define (http-transport:client-connect run-id iface port)
(let* ((uri-dat (make-request method: 'POST uri: (uri-reference (conc "http://" iface ":" port "/ctrl"))))
(uri-api-dat (make-request method: 'POST uri: (uri-reference (conc "http://" iface ":" port "/api"))))
(serverdat (list iface port uri-dat uri-api-dat))
(login-res (rmt:login-no-auto-client-setup serverdat run-id)))
(if (and (list? login-res)
(car login-res))
(begin
(hash-table-set! *runremote* run-id serverdat)
(debug:print-info 2 "Logged in and connected to " iface ":" port)
(hash-table-set! *runremote* run-id serverdat)
serverdat)
(begin
(debug:print-info 0 "ERROR: Failed to login or connect to " iface ":" port)
#f))))
;; run http-transport:keep-running in a parallel thread to monitor that the db is being
;; used and to shutdown after sometime if it is not.
;;
(define (http-transport:keep-running server-id)
;; if none running or if > 20 seconds since
;; server last used then start shutdown
|
|
|
|
>
|
|
|
|
|
|
|
|
|
|
|
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
|
(thread-terminate! th2)
(debug:print-info 11 "got res=" res)
res)))))
;;
;; connect
;;
(define (http-transport:client-connect iface port)
(let* ((uri-dat (make-request method: 'POST uri: (uri-reference (conc "http://" iface ":" port "/ctrl"))))
(uri-api-dat (make-request method: 'POST uri: (uri-reference (conc "http://" iface ":" port "/api"))))
(server-dat (list iface port uri-dat uri-api-dat)))
;; (login-res (server:ping-server run-id server-dat))) ;; login-no-auto-client-setup server-dat run-id)))
server-dat))
;; (if (and (list? login-res)
;; (car login-res))
;; (begin
;; (hash-table-set! *runremote* run-id server-dat)
;; (debug:print-info 2 "Logged in and connected to " iface ":" port)
;; (hash-table-set! *runremote* run-id server-dat)
;; server-dat)
;; (begin
;; (debug:print-info 0 "ERROR: Failed to login or connect to " iface ":" port)
;; #f))))
;; run http-transport:keep-running in a parallel thread to monitor that the db is being
;; used and to shutdown after sometime if it is not.
;;
(define (http-transport:keep-running server-id)
;; if none running or if > 20 seconds since
;; server last used then start shutdown
|