Racket-y
This commit is contained in:
parent
0c633d91e1
commit
98e9bc7f9c
|
@ -76,12 +76,8 @@
|
||||||
|
|
||||||
(define/private (register-with-host)
|
(define/private (register-with-host)
|
||||||
(define FMT "\nworking off-line\n")
|
(define FMT "\nworking off-line\n")
|
||||||
(define FMTtry
|
(define FMTtry (string-append "unable to register with ~a after ~s tries" FMT))
|
||||||
(string-append "unable to register with ~a after ~s tries"
|
(define FMTcom (string-append "unable to register with ~a due to protocol problems" FMT))
|
||||||
FMT))
|
|
||||||
(define FMTcom
|
|
||||||
(string-append "unable to register with ~a due to protocol problems"
|
|
||||||
FMT))
|
|
||||||
;; Input-Port -> [-> Void]
|
;; Input-Port -> [-> Void]
|
||||||
;; create closure (for thread) to receive messages and signal events
|
;; create closure (for thread) to receive messages and signal events
|
||||||
(define (RECEIVE in)
|
(define (RECEIVE in)
|
||||||
|
@ -101,7 +97,7 @@
|
||||||
(define msg (tcp-receive in))
|
(define msg (tcp-receive in))
|
||||||
(cond
|
(cond
|
||||||
[(sexp? msg) (prec msg) RECEIVE] ;; break loop if EOF
|
[(sexp? msg) (prec msg) RECEIVE] ;; break loop if EOF
|
||||||
[#t (error 'RECEIVE "sexp expected, received: ~e" msg)])))))))
|
[else (error 'RECEIVE "sexp expected, received: ~e" msg)])))))))
|
||||||
RECEIVE)
|
RECEIVE)
|
||||||
;; --- now register, obtain connection, and spawn a thread for receiving
|
;; --- now register, obtain connection, and spawn a thread for receiving
|
||||||
(parameterize ([current-custodian *rec*])
|
(parameterize ([current-custodian *rec*])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user