mirror of
https://github.com/aljazceru/pear-docs.git
synced 2025-12-17 22:44:21 +01:00
Add err handlers to swarm connections (#70)
This commit is contained in:
@@ -37,6 +37,7 @@ swarm.on('connection', conn => {
|
||||
conns.push(conn)
|
||||
conn.once('close', () => conns.splice(conns.indexOf(conn), 1))
|
||||
conn.on('data', data => console.log(`${name}: ${data}`))
|
||||
conn.on('error', e => console.log(`Connection error: ${e}`))
|
||||
})
|
||||
|
||||
// Broadcast stdin to all connections
|
||||
|
||||
Reference in New Issue
Block a user