Megatest

Check-in [939ef5990f]
Login
Overview
Comment:Switch to s11n for serialization in place of read/write.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v2.0001
Files: files | file ages | folders
SHA1: 939ef5990ff34728d06946dd5cecc811f665bda8
User & Date: matt on 2022-01-03 18:31:13
Other Links: branch diff | manifest | tags
Context
2022-01-04
07:58
wip check-in: 3881155cc5 user: matt tags: v2.0001
2022-01-03
18:31
Switch to s11n for serialization in place of read/write. check-in: 939ef5990f user: matt tags: v2.0001
18:24
wip, more tests passing check-in: 3333a49fd4 user: matt tags: v2.0001
Changes

Modified ulex/ulex.scm from [5f309c38c1] to [ae5f9ebc41].

65
66
67
68
69
70
71

72
73
74
75
76
77
78
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79







+







	
	address-info
	mailbox
	matchable
	queues
	regex
	regex-case
	s11n
	srfi-1
	srfi-18
	srfi-4
	srfi-69
	system-information
	tcp6
	typed-records
195
196
197
198
199
200
201
202
203


204
205
206
207
208
209
210
196
197
198
199
200
201
202


203
204
205
206
207
208
209
210
211







-
-
+
+







	(ulex-handler udata dat) ;; no transmission needed
	(handle-exceptions ;; TODO - MAKE THIS EXCEPTION CMD SPECIFIC?
	    exn
	    #f
	  (let-values (((inp oup)(tcp-connect host-port)))
	    (let ((res (if (and inp oup)
			   (begin
			     (write dat oup)
			     (read inp)) ;; yes, we always want an ack
			     (serialize dat oup)
			     (deserialize inp)) ;; yes, we always want an ack
			   (begin
			     (print "ERROR: send called but no receiver has been setup. Please call setup first!")
			     #f))))
	      (close-input-port inp)
	      (close-output-port oup)
	      res)))))) ;; res will always be 'ack

280
281
282
283
284
285
286
287

288
289

290
291
292
293
294
295
296
281
282
283
284
285
286
287

288
289

290
291
292
293
294
295
296
297







-
+

-
+








;; given an already set up uconn start the cmd-loop
;;
(define (ulex-cmd-loop uconn)
  (let* ((serv-listener (udat-socket uconn)))
    (let loop ((state 'start))
      (let-values (((inp oup)(tcp-accept serv-listener)))
	(let* ((rdat  (read inp)) ;; '(my-host-port qrykey cmd params)
	(let* ((rdat  (deserialize inp)) ;; '(my-host-port qrykey cmd params)
	       (resp  (ulex-handler uconn rdat)))
	  (if resp (write resp oup))
	  (if resp (serialize resp oup))
	  (close-input-port inp)
	  (close-output-port oup))
	(loop state)))))

;; add a proc to the cmd list, these are done symetrically (i.e. in all instances)
;; so that the proc can be dereferenced remotely
;;