Wait for credit before closing the connection.
This commit is contained in:
parent
07922cec64
commit
913653bba9
|
@ -10,11 +10,13 @@
|
||||||
(define ((connection-handler local-addr remote-addr) self-pid)
|
(define ((connection-handler local-addr remote-addr) self-pid)
|
||||||
(transition 'no-state
|
(transition 'no-state
|
||||||
(role 'date-sender (topic-publisher (tcp-channel local-addr remote-addr (wild)))
|
(role 'date-sender (topic-publisher (tcp-channel local-addr remote-addr (wild)))
|
||||||
#:state state)
|
#:state state
|
||||||
|
[(tcp-channel _ _ (tcp-credit _))
|
||||||
|
(transition state
|
||||||
|
(kill))])
|
||||||
(send-message (tcp-channel local-addr remote-addr
|
(send-message (tcp-channel local-addr remote-addr
|
||||||
(string->bytes/utf-8
|
(string->bytes/utf-8
|
||||||
(format "~a\n" (current-inexact-milliseconds)))))
|
(format "~a\n" (current-inexact-milliseconds)))))))
|
||||||
(kill)))
|
|
||||||
|
|
||||||
(define (listener local-addr)
|
(define (listener local-addr)
|
||||||
(transition 'no-state
|
(transition 'no-state
|
||||||
|
|
Loading…
Reference in New Issue