24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
(declare (uses api))
(declare (uses http-transport))
(include "common_records.scm")
(declare (uses portlogger))
(import portlogger)
(declare (uses nmsg-transport))
(import (prefix nmsg-transport nmsg:))
(use (prefix pkts pkts:) srfi-18)
;;
;; THESE ARE ALL CALLED ON THE CLIENT SIDE!!!
;;
;; generate entries for ~/.megatestrc with the following
|
|
|
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
(declare (uses api))
(declare (uses http-transport))
(include "common_records.scm")
(declare (uses portlogger))
(import portlogger)
(declare (uses nmsg-transport))
(import nmsg-transport)
(use (prefix pkts pkts:) srfi-18)
;;
;; THESE ARE ALL CALLED ON THE CLIENT SIDE!!!
;;
;; generate entries for ~/.megatestrc with the following
|
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
'main
'passive)))
(port-num (portlogger:open-run-close portlogger:find-port))
(nmsg-conn (nmsg:start-server port-num))
(pktspec (nmsg-pktspec *nmsg-conndat*))
(pktdir (conc (get-environment-variable "MT_RUN_AREA_HOME")
"/.server-pkts")))
;; server is started, now create pkt if needed
(if (eq? server-type 'main)
(nmsg-pkt-set! *nmsg-conndat*
(pkts:write-alist-pkt
pktdir
`((hostname . ,(get-host-name))
(port . ,port-num)
(pid . ,(current-process-id)))
pktspec)))
(nmsg-conn-set! *nmsg-conndat* nmsg-conn)
))
;;======================================================================
;; S U P P O R T F U N C T I O N S
;;======================================================================
;; if a server is either running or in the process of starting call client:setup
;; else return #f to let the calling proc know that there is no server available
|
>
|
>
|
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
'main
'passive)))
(port-num (portlogger:open-run-close portlogger:find-port))
(nmsg-conn (nmsg:start-server port-num))
(pktspec (nmsg-pktspec *nmsg-conndat*))
(pktdir (conc (get-environment-variable "MT_RUN_AREA_HOME")
"/.server-pkts")))
(if (not (directory? pktdir))(create-directory pktdir))
;; server is started, now create pkt if needed
(if (eq? server-type 'main)
(nmsg-pkt-set! *nmsg-conndat*
(pkts:write-alist->pkt
pktdir
`((hostname . ,(get-host-name))
(port . ,port-num)
(pid . ,(current-process-id)))
pktspec)))
(nmsg-conn-set! *nmsg-conndat* nmsg-conn)
(mutex-unlock! (nmsg-mutex *nmsg-conndat*))
))
;;======================================================================
;; S U P P O R T F U N C T I O N S
;;======================================================================
;; if a server is either running or in the process of starting call client:setup
;; else return #f to let the calling proc know that there is no server available
|