Skip to content

Commit 4196c26

Browse files
authored
Merge pull request webtorrent#332 from guanzo/bugfix
Check if socket is already connected in _openSocket().
2 parents 20368d2 + fc2f84a commit 4196c26

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/client/websocket-tracker.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ class WebSocketTracker extends Tracker {
172172
this.socket = socketPool[this.announceUrl]
173173
if (this.socket) {
174174
socketPool[this.announceUrl].consumers += 1
175+
if (this.socket.connected) {
176+
this._onSocketConnectBound()
177+
}
175178
} else {
176179
this.socket = socketPool[this.announceUrl] = new Socket(this.announceUrl)
177180
this.socket.consumers = 1

0 commit comments

Comments
 (0)