sshRemoteAgentHostService.ts ×4

Frontier kind: Code frontier

unlabeled · c_2b689ea667cb

8 tests · 11078 LOC · 48 files · introduces 0 tests · 43 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges43 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1683 ranges11078 lines · 48 files · Browse complete extent
All tests (intent)
8 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 43 introduced LOC across 5 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/sshRemoteAgentHostService.ts 36 introduced LOC · 4 ranges

Open complete file

536 */
537 detachSshClient(): void {
538 > this._sshClientDetached = true; sshRemoteAgentHostService.ts
539 > this.sshClient.removeListener('close', this._sshCloseListener);
540 > this.sshClient.removeListener('error', this._sshErrorListener);
541 > }
542
543 relaySend(data: string): void {
619 if (existing) {
620 if (replaceRelay) {
621 > // Tear down the old relay and create a fresh one, following sshRemoteAgentHostService.ts
622 > // the same dispose-and-recreate pattern as TunnelAgentHostMainService.
623 > // The SSH client is detached so only the WebSocket relay is closed.
624 > this._logService.info(`${LOG_PREFIX} Reconnecting relay for existing SSH tunnel ${connectionKey}`);
625 > const { sshClient, remotePort, connectionToken } = existing;
626 >
627 > // Remove from map and detach SSH client before disposing so
628 > // the old relay's close handler (conn?.dispose()) is a no-op.
629 > this._connections.deleteAndLeak(connectionKey);
630 > existing.detachSshClient();
631 > existing.dispose();
632 >
633 > // Create fresh relay and connection. If relay creation fails,
634 > // clean up the detached SSH client so it doesn't leak.
635 > const connectionId = connectionKey;
636 > try {
637 > let conn: SSHConnection | undefined; // eslint-disable-line prefer-const
638 > // Bound the relay creation: a silently dead SSH client
639 > // (TCP half-open, ssh2 keepalive hasn't fired yet) can
640 > // leave forwardOut's callback unfired, hanging the whole
641 > // promise chain. raceTimeout returns undefined on timeout.
642 > const timeoutMs = this.relayCreationTimeoutMs;
643 > const relay = await raceTimeout(
644 > this._createWebSocketRelay(
645 > sshClient, '127.0.0.1', remotePort, connectionToken,
646 > (data: string) => this._onDidRelayMessage.fire({ connectionId, data }),
647 > () => { conn?.dispose(); },
648 > ),
649 > timeoutMs,
650 > );
651 if (!relay) {
652 throw new Error(`SSH relay creation timed out after ${timeoutMs}ms (SSH client appears unresponsive)`);
678 sshConfigHost: config.sshConfigHost,
679 };
680 > } catch (err) { sshRemoteAgentHostService.ts
681 sshClient.end();
682 this._onDidRelayClose.fire(connectionId);
src/vs/base/common/lifecycle.ts 7 introduced LOC · 1 range

Open complete file

829 */
830 deleteAndLeak(key: K): V | undefined {
831 > const value = this._store.get(key); lifecycle.ts
832 > if (value) {
833 > setParentOfDisposable(value, null);
834 > }
835 > this._store.delete(key);
836 > return value;
837 > }
838
839 keys(): IterableIterator<K> {