You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// 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?
The text was updated successfully, but these errors were encountered:
ErikEngerd
changed the title
Question on docs...
Question on docs for yamux.Server(): max 1 per process or per ReadWriteCloser?
Aug 22, 2024
As occurs many times on github, I am answering my own questions. It turns out there was a sneaky error in the logic of my test case causing connections to be mixed up. Yamux is working fine.
My question is still relevant, although I am quite convinced now that the restriction is per connection not per go process.
Hi,
The docs for yamux.Server() say
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?
The text was updated successfully, but these errors were encountered: