MCPcopy
hub / github.com/SnapDrop/snapdrop / _onChunkReceived

Method _onChunkReceived

client/scripts/network.js:188–199  ·  view source on GitHub ↗
(chunk)

Source from the content-addressed store, hash-verified

186 }
187
188 _onChunkReceived(chunk) {
189 if(!chunk.byteLength) return;
190
191 this._digester.unchunk(chunk);
192 const progress = this._digester.progress;
193 this._onDownloadProgress(progress);
194
195 // occasionally notify sender about our progress
196 if (progress - this._lastProgress < 0.01) return;
197 this._lastProgress = progress;
198 this._sendProgress(progress);
199 }
200
201 _onDownloadProgress(progress) {
202 Events.fire('file-progress', { sender: this._peerId, progress: progress });

Callers 1

_onMessageMethod · 0.95

Calls 3

_onDownloadProgressMethod · 0.95
_sendProgressMethod · 0.95
unchunkMethod · 0.80

Tested by

no test coverage detected