external-latency driver

This commit is contained in:
Tony Garnock-Jones 2014-05-04 15:55:11 -04:00
parent 7abce613fa
commit 77133a2cf5
1 changed files with 31 additions and 0 deletions

31
external-latency.rkt Normal file
View File

@ -0,0 +1,31 @@
#lang racket/base
(require racket/match)
(require racket/system)
(require logbook)
(define entry-name (standard-logbook-entry-name))
(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.")