MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / onSocketClose

Function onSocketClose

out/cli.cjs:54541–54568  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

54539 if (client[kHTTPConnVersion] !== "h2") {
54540 if (parser.statusCode && !parser.shouldKeepAlive) {
54541 parser.onMessageComplete();
54542 return;
54543 }
54544 }
54545 util4.destroy(this, new SocketError("other side closed", util4.getSocketInfo(this)));
54546 }
54547 function onSocketClose() {
54548 const { [kClient]: client, [kParser]: parser } = this;
54549 if (client[kHTTPConnVersion] === "h1" && parser) {
54550 if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) {
54551 parser.onMessageComplete();
54552 }
54553 this[kParser].destroy();
54554 this[kParser] = null;
54555 }
54556 const err = this[kError] || new SocketError("closed", util4.getSocketInfo(this));
54557 client[kSocket] = null;
54558 if (client.destroyed) {
54559 assert2(client[kPending] === 0);
54560 const requests = client[kQueue].splice(client[kRunningIdx]);
54561 for (let i3 = 0; i3 < requests.length; i3++) {
54562 const request3 = requests[i3];
54563 errorRequest(client, request3, err);
54564 }
54565 } else if (client[kRunning] > 0 && err.code !== "UND_ERR_INFO") {
54566 const request3 = client[kQueue][client[kRunningIdx]];
54567 client[kQueue][client[kRunningIdx]++] = null;
54568 errorRequest(client, request3, err);
54569 }
54570 client[kPendingIdx] = client[kRunningIdx];
54571 assert2(client[kRunning] === 0);

Callers

nothing calls this directly

Calls 6

errorRequestFunction · 0.85
resume2Function · 0.85
fireEventFunction · 0.85
onMessageCompleteMethod · 0.80
destroyMethod · 0.45
emitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…