MCPcopy Create free account
hub / github.com/mscdex/ssh2 / closeStream

Function closeStream

lib/protocol/SFTP.js:3807–3820  ·  view source on GitHub ↗
(stream, cb, err)

Source from the content-addressed store, hash-verified

3805};
3806
3807function closeStream(stream, cb, err) {
3808 if (!stream.handle)
3809 return onclose();
3810
3811 stream.sftp.close(stream.handle, onclose);
3812
3813 function onclose(er) {
3814 er = er || err;
3815 cb(er);
3816 stream.isClosed = true;
3817 if (!er)
3818 stream.emit('close');
3819 }
3820}
3821
3822ReadStream.prototype.close = function(cb) {
3823 this.destroy(null, cb);

Callers 1

SFTP.jsFile · 0.85

Calls 2

oncloseFunction · 0.85
closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…