Problem 2: peer disconnected = connection crash?
Closed this issue · 2 comments
SonnyAD commented
Hi,
I was testing Problem 2 again, and I noticed with 3 peers in Problem 2 that if one of the peer disconnect, then the lest 2 peers can't discuss anymore.
Do you have any ideas why?
mafintosh commented
By Problem 2, you mean this one? https://github.com/hypercore-protocol/p2p-multiwriter-with-autobase/tree/main/problems/02
I think the stream might be closing the stdin/stdout on socket close actually.
Try doing encryptedSocket.on('data', (data) => process.stdout.write(data)) and process.stdin.on('data', (data) => encryptedSocket.write(data)) instead
SonnyAD commented
Works good thanks.