-
Notifications
You must be signed in to change notification settings - Fork 255
Question on docs for yamux.Server(): max 1 per process or per ReadWriteCloser? #134
Description
Hi,
The docs for yamux.Server() say
// Server is used to initialize a new server-side connection.
// There must be at most one server-side connection. If a nil config is
// provided, the DefaultConfiguration will be used.
It is unclear to me if this applies globally or for a single connection. Globally would mean that there is at most only one session in every go process.
I am asking this because in my unit tests there is one test where I am using many yamux.Servers and it looks like messages are getting mixed up. Yet, looking at the source code of yamux I could not see quickly if there is any global state that would limit yamux.Servers to 1 per process. In my application, I am making sure there is at most 1 yamux Server per process, but in my unit test there is one test where I am using many.
So what is the limit? One server per process or one server per connection (ReadWriteCloser)? Also, if there is a limit per process, then where can I see in the source code that there is this limitation?