Megatest

Diff
Login

Differences From Artifact [5d18895bb2]:

To Artifact [1c9abf93c8]:


77
78
79
80
81
82
83

84


85
86
87
88
89
90
91
92
93

94
95
96
97
98
99
100
77
78
79
80
81
82
83
84

85
86
87
88
89
90
91
92
93
94

95
96
97
98
99
100
101
102







+
-
+
+








-
+







	  (udat-captain-port-set!    udata port)
	  (udat-captain-pid-set!     udata pid)
	  (if (ping udata (conc ipaddr ":" port))
	      udata
	      (begin
		(remove-captain-pkt udata captn)
		(setup))))
	(begin
	(setup-as-captain udata)) ;; this saves the thread to captain-thread and starts the thread
	  (setup-as-captain udata)  ;; this saves the thread to captain-thread and starts the thread
	  (setup)))
    ))

;; connect to a specific dbfile
(define (connect udata dbfname dbtype)
  udata)

(define (ping udata host-port)
  (let ((cookie (make-cookie udata)))
    (send udata host-port 'ping "just pinging" (current-seconds))
    (send udata host-port 'ping "just pinging" (conc (current-seconds)))
    ;; (mailbox-rec
    ))

;;======================================================================
;; network utilities
;;======================================================================

439
440
441
442
443
444
445
446
447


448
449
450
451
452
453
454
441
442
443
444
445
446
447


448
449
450
451
452
453
454
455
456







-
-
+
+







		  (send udata host:port "version" qrykey val)))
	       ((rucaptain)
		(send udata host:port "iamcaptain" qrykey (if (udat-my-cpkt-key udata)
							      "yes"
							      "no")))
	       (else
		;; (send-ack udata host:port qrykey)
		(add-to-work-queue udata (get-peer-dat udata host:port) handlerkey qrykey data)))
	     (else (print "BAD DATA? handler=" handlerkey " data=" data)))))
		(add-to-work-queue udata (get-peer-dat udata host:port) handlerkey qrykey data))))
	    (else (print "BAD DATA? controldat=" controldat " data=" data))))
	(loop state)))))

;; add a proc to the handler list
(define (register-handler udata key proc)
  (hash-table-set! (udat-handlers udata) key proc))