12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Megatest. If not, see <http://www.gnu.org/licenses/>.
(declare (unit nmsg-transport))
(module
nmsg-transport
(
nmsg:start-server
nmsg:open-send-close
nmsg:open-send-receive
)
(import scheme posix chicken data-structures ports)
(use pkts)
(use nanomsg srfi-18)
;;start a server, returns the connection
|
>
>
>
>
>
|
|
|
|
|
|
|
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with Megatest. If not, see <http://www.gnu.org/licenses/>.
;;======================================================================
;; Support routines for nmsg usage.
;; This should be reusable, non-megatest specific stuff
;;======================================================================
(declare (unit nmsg-transport))
(module
nmsg-transport
(
nmsg:start-server
nmsg:open-send-close
nmsg:open-send-receive
)
(import scheme posix chicken data-structures ports)
(use pkts)
(use nanomsg srfi-18)
;;start a server, returns the connection
|
112
113
114
115
116
117
118
119
|
(thread-terminate! th1))
"timer thread")))
(thread-start! th1)
(thread-start! th2)
(thread-join! th1)
res))))
)
|
>
>
>
|
>
|
117
118
119
120
121
122
123
124
125
126
127
128
|
(thread-terminate! th1))
"timer thread")))
(thread-start! th1)
(thread-start! th2)
(thread-join! th1)
res))))
;; get a signature for identifing this process
(define (nmsg:get-process-signature)
(conc (get-host-name) " " (current-process-id)))
)
|