Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Do we really need the single connection iOS design? #751
Right now our iOS code allows for exactly one stream to exist in each direction between two iOS devices. The reason for this restriction is that we ran into issues when we let there be two streams in each direction. To be clear, the multi peer connectivity framework absolutely supports having multiple streams in the same direction. It does this by letting us give each stream a unique name. But in practice we had a lot of connection failures when we had two streams in the same direction.
So our fix was to only allow for a single stream in each direction and to then build a painfully complex mux layer at the Node.js layer of code to let us open TCP connections in both directions on that single underlying stream using our multiplex layer.
But we've always had the suspicion that the problems we ran into were the result of coding bugs on our part and not problems with the multi-peer connectivity framework. If that is true then we could get rid of the single stream restriction and radically reduce the complexity of our mux layer by creating a pair of streams in each direction for each device. This would let us treat each direction separately and have the identical behavior (and the identical Node.js code) for Android. It would also simplify the iOS native code.