hashicorp / yamux

Golang connection multiplexing library
Mozilla Public License 2.0
2.19k stars 232 forks source link

Implements "CloseChan" functionality for "Stream" #115

Open hadi77ir opened 1 year ago

hadi77ir commented 1 year ago

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).

hashicorp-cla commented 1 year ago

CLA assistant check
All committers have signed the CLA.