MCPcopy Index your code
hub / github.com/nodejs/node / writeAfterFIN

Function writeAfterFIN

lib/net.js:701–721  ·  view source on GitHub ↗
(chunk, encoding, cb)

Source from the content-addressed store, hash-verified

699// of the other side sending a FIN. The standard 'write after end'
700// is overly vague, and makes it seem like the user's code is to blame.
701function writeAfterFIN(chunk, encoding, cb) {
702 if (!this.writableEnded) {
703 return stream.Duplex.prototype.write.call(this, chunk, encoding, cb);
704 }
705
706 if (typeof encoding === 'function') {
707 cb = encoding;
708 encoding = null;
709 }
710
711 const er = genericNodeError(
712 'This socket has been ended by the other party',
713 { code: 'EPIPE' },
714 );
715 if (typeof cb === 'function') {
716 defaultTriggerAsyncIdScope(this[async_id_symbol], process.nextTick, cb, er);
717 }
718 this.destroy(er);
719
720 return false;
721}
722
723Socket.prototype.setTimeout = setStreamTimeout;
724

Callers

nothing calls this directly

Calls 3

callMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…