It seems that when Close() is called on a stream with go-yamux, it’s possible that the remote does not immediately realize the stream has been closed.
I’m not running into this issue anymore now that I changed the behavior of my app to not rely on the Close notification going through to signal done, but I wonder if this could lead to streams leaking / being left unclosed on one end of the connection.
There are a few other things that can be improved a bit, probably:
Atomic integers can be updated to use the new atomic.Int64
Is the rtt measurement / window size goroutine necessary? (Can’t we spin off a goroutine to measure it periodically when Read is called?)
Hey, I receive annoying [WARN] yamux: Discarding data for stream messages in my logs, did you manage to get rid of them? AFAIK they come from Identify service.