-
- Downloads
MultiplexedSocket: use incrementing channel number
'Birthday paradox' implies that if the two peers create channels at the same time, there is a non-zero chance of collision even for small amount of channels, because channel ids are 16 bits: * >50% probability of collision with N=256 * >1% probability of collision with N=40 * 0.2% probability of collision with N=16 For this reason, use incrementing channel numbers, but start at 0x8000 for the server and at 1 for the client. This method guarantees 0-collision for at least the first 2^15-1 channels opened each side, and reduces the probability of collision after that. Change-Id: I913cf2962a1fc577a6d24b9184a25d75d2473574
Loading
Please register or sign in to comment