blob: 3c66015bdd07f596a2605bc7b8db4e6cfb0b9cb8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#! /usr/bin/env racket
#lang racket
(require "layer2.rkt")
;(define verbose? (make-parameter #f))
(define connect-host? (make-parameter null))
(define connect-port? (make-parameter null))
(define greeting
(command-line
#:once-each
; [("-v") "Verbose mode" (verbose? #t)]
[("-c" "--connect") host port
"Connect to server <host> <port>"
(connect-host? host)
(connect-port? (string->number port))
]))
; Connect
(if (or (null? (connect-host?)) (null? (connect-port?)))
(display "Using stdin")
(let-values ([(cin cout) (tcp-connect (connect-host?) (connect-port?))])
(display (format "Connected to ~s ~s ~n" (connect-host?) (connect-port?)))
(current-input-port cin)))
;
(layer2-read-ebus-loop (current-input-port))
|