Closed SourceBoy closed 7 years ago
Test result indicates that the drain event from peer1 never fired:
peer1.on('connect', () => {
stream.on('data', (chunk) => {
if (peer1.write(chunk) === false) {
stream.pause()
}
})
// Doesn't fire
peer1.on('drain', () => {
stream.resume()
})
})
Which webrtc implementation are you using in Node.js? wrtc
?
@feross electron-webrtc@0.3.0 src/RTCDataChannel.js#L164
Looks like this RTCDataChannel.send() may have a bug and is somehow causing this.
Switching to wrtc with this binary on Linux worked.
The memory usage is however, rather high. Looking at this makes me wonder if the RAM ate the whole 1GB file since both sender & recipient's memory spiked up 1GB (Closing the data channel or destroying the peer instance doesn't free the memory either)
@SourceBoy glad you got your issue figured out. thanks for opening an issue on the electron-webrtc repo.
I'm observing a weird behavior under Node 6.9.4:
It'd seem that
self._channel.bufferedAmount is > self._maxBufferedAmount
; doesn't the channel buffer get flushed upon send()?