Skip to content
Snippets Groups Projects
Commit 283afb28 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

[fix] #1116 Do not start a new stream with a WS2P connection which is not connected yet

parent 8d5c1ed9
Branches
Tags
No related merge requests found
......@@ -32,6 +32,7 @@ export class WS2PStreamer extends stream.Transform {
}
} catch (e) {
logger.warn('WS2P >> Streamer >>', e)
this.ws2pc.close()
}
done && done();
}
......
......@@ -22,9 +22,15 @@ export class WS2PClient {
},
expectedPub
)
// Streaming
const streamer = new WS2PStreamer(c)
c.connected
.then(() => {
// Streaming
server.pipe(streamer)
})
.catch(() => {
server.unpipe(streamer)
})
c.closed.then(() => {
server.unpipe(streamer)
})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment