For a personal project, I have an interface through which I implement wrappers for yamux, smux and other multiplexers.
The only difference between these were differences in the APIs surrounding the "CloseChan" that I tried to make consistent: "smux" had a channel that was closed once the stream was closed or reset but not for the "Session" (in the latest commit it has been implemented), while in "yamux" this is only implemented for "Session"s and not for "Stream"s.
So far, this is what I've done with the implementation and I think it is a nice thing to have, as it makes it possible to know when the stream has been closed and is of no use (without relying on io.EOF and other errors).
For a personal project, I have an interface through which I implement wrappers for yamux, smux and other multiplexers.
The only difference between these were differences in the APIs surrounding the "CloseChan" that I tried to make consistent: "smux" had a channel that was closed once the stream was closed or reset but not for the "Session" (in the latest commit it has been implemented), while in "yamux" this is only implemented for "Session"s and not for "Stream"s.
So far, this is what I've done with the implementation and I think it is a nice thing to have, as it makes it possible to know when the stream has been closed and is of no use (without relying on
io.EOF
and other errors).