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

Function socketOnEnd

lib/_http_client.js:622–638  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

620}
621
622function socketOnEnd() {
623 const socket = this;
624 const req = this._httpMessage;
625 const parser = this.parser;
626
627 if (!req.res && !req.socket._hadError) {
628 // If we don't have a response then we know that the socket
629 // ended prematurely and we need to emit an error on the request.
630 req.socket._hadError = true;
631 emitErrorEvent(req, new ConnResetException('socket hang up'));
632 }
633 if (parser) {
634 parser.finish();
635 freeParser(parser, req, socket);
636 }
637 socket.destroy();
638}
639
640function socketOnData(d) {
641 const socket = this;

Callers

nothing calls this directly

Calls 4

emitErrorEventFunction · 0.85
freeParserFunction · 0.85
finishMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…