32 lines
775 B
Racket
32 lines
775 B
Racket
|
#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.")
|