Do we really need the single connection iOS design? #751

yaronyg opened this Issue Jul 11, 2016 · 1 comment


None yet
1 participant

yaronyg commented Jul 11, 2016

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.

@yaronyg yaronyg added this to the New Infra milestone Jul 11, 2016

@yaronyg yaronyg added 0 - Icebox and removed 0 - Icebox labels Jul 11, 2016

@yaronyg yaronyg closed this Aug 3, 2016

@yaronyg yaronyg added 4 - Done and removed 1 - Backlog labels Aug 3, 2016


This comment has been minimized.

Show comment
Hide comment

yaronyg Aug 3, 2016


No. We don't.


yaronyg commented Aug 3, 2016

No. We don't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment