Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Commit

Permalink
chore: do not reset inbound stream
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos committed Aug 19, 2020
1 parent ec5ae25 commit f209d04
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/pubsub/peer-streams.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,6 @@ class PeerStreams extends EventEmitter {
* @returns {void}
*/
attachInboundStream (stream) {
// If an inbound stream already exists,
// use the abort controller to gently close it
const _prevStream = this.inboundStream
if (_prevStream) {
this._inboundAbortController.abort()
}

// Create and attach a new inbound stream
// The inbound stream is:
// - abortable, set to only return on abort, rather than throw
Expand All @@ -125,10 +118,7 @@ class PeerStreams extends EventEmitter {
{ returnOnAbort: true }
)

// Only emit if the connection is new
if (!_prevStream) {
this.emit('stream:inbound')
}
this.emit('stream:inbound')
}

/**
Expand Down

0 comments on commit f209d04

Please sign in to comment.