MCPcopy Create free account
hub / github.com/angular/dev-infra / connect

Function connect

github-actions/bazel/configure-remote/configure-remote.js:8101–8211  ·  view source on GitHub ↗
(client)

Source from the content-addressed store, hash-verified

8099 });
8100 });
8101 }
8102 };
8103 var createRedirectInterceptor = require_redirect_interceptor();
8104 function onError(client, err) {
8105 if (client[kRunning] === 0 && err.code !== "UND_ERR_INFO" && err.code !== "UND_ERR_SOCKET") {
8106 assert(client[kPendingIdx] === client[kRunningIdx]);
8107 const requests = client[kQueue].splice(client[kRunningIdx]);
8108 for (let i = 0; i < requests.length; i++) {
8109 const request = requests[i];
8110 util.errorRequest(client, request, err);
8111 }
8112 assert(client[kSize] === 0);
8113 }
8114 }
8115 function connect(client) {
8116 return __async(this, null, function* () {
8117 var _a, _b, _c;
8118 assert(!client[kConnecting]);
8119 assert(!client[kHTTPContext]);
8120 let { host, hostname, protocol, port } = client[kUrl];
8121 if (hostname[0] === "[") {
8122 const idx = hostname.indexOf("]");
8123 assert(idx !== -1);
8124 const ip = hostname.substring(1, idx);
8125 assert(net.isIP(ip));
8126 hostname = ip;
8127 }
8128 client[kConnecting] = true;
8129 if (channels.beforeConnect.hasSubscribers) {
8130 channels.beforeConnect.publish({
8131 connectParams: {
8132 host,
8133 hostname,
8134 protocol,
8135 port,
8136 version: (_a = client[kHTTPContext]) == null ? void 0 : _a.version,
8137 servername: client[kServerName],
8138 localAddress: client[kLocalAddress]
8139 },
8140 connector: client[kConnector]
8141 });
8142 }
8143 try {
8144 const socket = yield new Promise((resolve2, reject) => {
8145 client[kConnector]({
8146 host,
8147 hostname,
8148 protocol,
8149 port,
8150 servername: client[kServerName],
8151 localAddress: client[kLocalAddress]
8152 }, (err, socket2) => {
8153 if (err) {
8154 reject(err);
8155 } else {
8156 resolve2(socket2);
8157 }
8158 });

Callers 2

[kConnect]Method · 0.70
_resumeFunction · 0.70

Calls 9

__asyncFunction · 0.70
connectH2Function · 0.70
connectH1Function · 0.70
onErrorFunction · 0.70
__spreadPropsFunction · 0.70
__spreadValuesFunction · 0.70
destroyMethod · 0.45
onMethod · 0.45
dispatchMethod · 0.45

Tested by

no test coverage detected