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

Method _sendFile

client/scripts/network.js:120–131  ·  view source on GitHub ↗
(file)

Source from the content-addressed store, hash-verified

118 }
119
120 _sendFile(file) {
121 this.sendJSON({
122 type: 'header',
123 name: file.name,
124 mime: file.type,
125 size: file.size
126 });
127 this._chunker = new FileChunker(file,
128 chunk => this._send(chunk),
129 offset => this._onPartitionEnd(offset));
130 this._chunker.nextPartition();
131 }
132
133 _onPartitionEnd(offset) {
134 this.sendJSON({ type: 'partition', offset: offset });

Callers 1

_dequeueFileMethod · 0.95

Calls 4

sendJSONMethod · 0.95
_onPartitionEndMethod · 0.95
nextPartitionMethod · 0.80
_sendMethod · 0.45

Tested by

no test coverage detected