Overview
Comment: | wip, ulex-simple server starts for main.db |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | v2.0001-configurable-transport |
Files: | files | file ages | folders |
SHA1: |
5a981df3db344669c358ab0d2714624f |
User & Date: | matt on 2022-01-17 18:07:59 |
Other Links: | branch diff | manifest | tags |
Context
2022-01-17
| ||
18:32 | ulex-simple now working well. check-in: ae15b052c0 user: matt tags: v2.0001-configurable-transport | |
18:07 | wip, ulex-simple server starts for main.db check-in: 5a981df3db user: matt tags: v2.0001-configurable-transport | |
16:42 | wip check-in: 7f7a2e36c5 user: matt tags: v2.0001-configurable-transport | |
Changes
Modified ulex-simple/dbmgr.scm from [156c31ac88] to [47dcbd2a6a].
︙ | |||
76 77 78 79 80 81 82 | 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | - + - + | ;; stored (for now) in *db-serv-info* ;; (defstruct servdat (host #f) (port #f) (uuid #f) (dbfile #f) |
︙ | |||
159 160 161 162 163 164 165 | 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | - + | ;; (define (rmt:open-main-connection remdat apath) (let* ((fullpath (db:dbname->path apath ".db/main.db")) (conns (servdat-conns remdat)) (conn (rmt:get-conn remdat apath ".db/main.db")) ;; (hash-table-ref/default conns fullpath #f)) ;; TODO - create call for this (myconn (servdat-uconn remdat))) (cond |
︙ | |||
291 292 293 294 295 296 297 298 299 300 301 302 303 304 | 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 | + + + + | ;; Defaults to current area ;; (define (rmt:send-receive cmd rid params #!key (attemptnum 1)(area-dat #f)) (let* ((apath *toppath*) (sinfo *db-serv-info*) (dbname (db:run-id->dbname rid))) (if (not *db-serv-info*) (begin (set! *db-serv-info* (make-servdat)) (set! sinfo *db-serv-info*))) (rmt:open-main-connection sinfo apath) (if rid (rmt:general-open-connection sinfo apath dbname)) ;; (if (not (member cmd '(log-to-main))) ;; (debug:print-info 0 *default-log-port* "rmt:send-receive "cmd" params="params)) (let* ((cdat (rmt:get-conn sinfo apath dbname))) (assert cdat "FATAL: rmt:send-receive-real called without the needed channels opened") (let* ((uconn (servdat-uconn sinfo)) ;; get the interface to ulex |
︙ | |||
540 541 542 543 544 545 546 | 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 | - + | (define (server-ready? uconn host-port key) ;; server-address is host:port (let* ((params `((cmd . ping)(key . ,key))) (data `((cmd . ping) (key . ,key) (params . ,params))) ;; I don't get it. (res (send-receive uconn host-port 'ping data))) |
︙ | |||
623 624 625 626 627 628 629 | 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 | - - + - + | (if (string>=? best-z candidate-z) best candidate))))) ;; use Z card as tie breaker (if (null? tail) new-best (loop (cdr tail) new-best))))))) |
︙ | |||
712 713 714 715 716 717 718 | 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 | - + | (delete-pkt) (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) (thread-sleep! 0.1) |
︙ |
Modified ulex-simple/ulex.scm from [95a5f80a6e] to [24167fae4d].
︙ | |||
90 91 92 93 94 95 96 | 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | - + | ;; udat struct, used by both caller and callee ;; instantiated as uconn by convention ;; (defstruct udat ;; the listener side (port #f) |
︙ | |||
214 215 216 217 218 219 220 | 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 | - + - | ;; (define (do-work uconn rdat) (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) (case cmd |
︙ |