MCPcopy
hub / github.com/di-sukharev/opencommit / reuseSocket

Method reuseSocket

out/cli.cjs:9529–9547  ·  view source on GitHub ↗
(...args)

Source from the content-addressed store, hash-verified

9527 }
9528 // only call on addRequest
9529 reuseSocket(...args) {
9530 super.reuseSocket(...args);
9531 const socket = args[0];
9532 const req = args[1];
9533 req.reusedSocket = true;
9534 const agentTimeout = this.options.timeout;
9535 if (getSocketTimeout(socket) !== agentTimeout) {
9536 socket.setTimeout(agentTimeout);
9537 debug5("%s reset timeout to %sms", socket[SOCKET_NAME], agentTimeout);
9538 }
9539 socket[SOCKET_REQUEST_COUNT]++;
9540 debug5(
9541 "%s(requests: %s, finished: %s) reuse on addRequest, timeout %sms",
9542 socket[SOCKET_NAME],
9543 socket[SOCKET_REQUEST_COUNT],
9544 socket[SOCKET_REQUEST_FINISHED_COUNT],
9545 getSocketTimeout(socket)
9546 );
9547 }
9548 [CREATE_ID]() {
9549 const id = this[CURRENT_ID]++;
9550 if (this[CURRENT_ID] === Number.MAX_SAFE_INTEGER) this[CURRENT_ID] = 0;

Callers

nothing calls this directly

Calls 3

getSocketTimeoutFunction · 0.85
debug5Function · 0.85
setTimeoutMethod · 0.80

Tested by

no test coverage detected