Skip to content
This repository was archived by the owner on Apr 24, 2023. It is now read-only.

Commit fc02af1

Browse files
authored
Merge pull request #19 from libp2p/fix-conn
fix(webrtc-star): use destroy instead of emit for closing a conn
2 parents 28e92e9 + 90c93f0 commit fc02af1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/webrtc-star/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ function WebRTCStar () {
7373
connected = true
7474
conn.destroy = channel.destroy.bind(channel)
7575

76+
channel.on('close', () => {
77+
conn.destroy()
78+
})
79+
7680
conn.getObservedAddrs = (callback) => {
7781
return callback(null, [ma])
7882
}

0 commit comments

Comments
 (0)