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)
|
||||
(transition 'no-state
|
||||
(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
|
||||
(string->bytes/utf-8
|
||||
(format "~a\n" (current-inexact-milliseconds)))))
|
||||
(kill)))
|
||||
(format "~a\n" (current-inexact-milliseconds)))))))
|
||||
|
||||
(define (listener local-addr)
|
||||
(transition 'no-state
|
||||
|
|
Loading…
Reference in New Issue