2014-05-04 19:55:11 +00:00
|
|
|
#lang racket/base
|
|
|
|
|
|
|
|
(require racket/match)
|
|
|
|
(require racket/system)
|
|
|
|
(require logbook)
|
|
|
|
|
2014-05-04 20:02:37 +00:00
|
|
|
(define L (default-logbook))
|
|
|
|
(define E (standard-logbook-entry L "minimart" "external-latency"))
|
|
|
|
(define entry-name (logbook-entry-name E))
|
2014-05-04 19:55:11 +00:00
|
|
|
|
|
|
|
(define (start-bg command)
|
|
|
|
(match-define (list #f #f pid #f control)
|
|
|
|
(process/ports (current-output-port)
|
|
|
|
(current-input-port)
|
|
|
|
(current-error-port)
|
|
|
|
command))
|
|
|
|
control)
|
|
|
|
|
|
|
|
(log-info "Starting server...")
|
|
|
|
(define server-control
|
|
|
|
(start-bg (format "racket echo-server.rkt --logbook-entry-name ~a" entry-name)))
|
|
|
|
|
|
|
|
(sleep 5)
|
|
|
|
|
|
|
|
(log-info "Starting client...")
|
|
|
|
(define client-control
|
|
|
|
(start-bg (format "racket echo-client.rkt --logbook-entry-name ~a" entry-name)))
|
|
|
|
|
|
|
|
(log-info "Waiting for client termination...")
|
|
|
|
(client-control 'wait)
|
|
|
|
(log-info "Waiting for server termination...")
|
|
|
|
(server-control 'wait)
|
|
|
|
(log-info "Done.")
|