Closed whatsdis closed 5 years ago
Listen for the close
event on connections that get emitted inside the connection
event.
E.g.
net.on('connection', (socket, details) => {
console.log('new connection!', details)
socket.once('close', () => {
console.log('Lost peer')
})
})
is there something like
network().on('leave', (peer) => {//triggered whenever a peer leaves or disconnected});