src/vs/platform/remote/common/remoteSocketFactoryService.ts

60 LOC · 39 covered · 21 uncovered · 5 ranges · 7 concepts · 1 introducers · 6 tests

File neighbourhood

The centred file is linked to every concept that introduces one of its ranges, every test that runs code from the file, and the gray connector concepts standing between those tests and the file's own introducer concepts. Undirected links join concepts to every file where they introduce source and concepts to the tests they introduce; arrows show specialization between the displayed concepts and bridge only concepts omitted from this view. Concept colors match the source ranges below; connector concepts have no source color and are shown in gray.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the file

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 related-file, concept, and source links on this page.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the filesrc/vs/platform/remote/common/managedSocket.ts · 145 LOCcommon/managedSocket.tssrc/vs/platform/remote/common/remoteAgentConnection.ts · 839 LOCcommon/remoteAgentConnec…src/vs/platform/sign/common/sign.ts · 22 LOCcommon/sign.tssrc/vs/platform/tunnel/node/tunnelService.ts · 265 LOCnode/tunnelService.tssrc/vs/workbench/api/node/extHostTunnelService.ts · 419 LOCnode/extHostTunnelServic…src/vs/workbench/services/remote/common/tunnelModel.ts · 1042 LOCcommon/tunnelModel.tsextHostTunnelService.ts ×3 · 22 introduced LOCextHostTunnelService.ts …extHostTunnelService.ts ×2 · 21 introduced LOCextHostTunnelService.ts …extHostTunnelService.ts ×4 · 38 introduced LOCextHostTunnelService.ts …extHostTunnelService.ts ×2 · 23 introduced LOCextHostTunnelService.ts …extHostTunnelService.ts ×1 · 9 introduced LOCextHostTunnelService.ts …extHostTunnelService.ts ×1 · 17 introduced LOCextHostTunnelService.ts …remoteAgentConnection.ts ×53 · 823 introduced LOCremoteAgentConnection.ts…extHostTunnelService.test|title=ExtHostTunnelService findPorts|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/node/extHostTunnelService.test|title=ExtHostTunnelService findPorts|occurrence=1extHostTunnelService.tes…extHostTunnelService.test|title=ExtHostTunnelService getSockets|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/node/extHostTunnelService.test|title=ExtHostTunnelService getSockets|occurrence=1extHostTunnelService.tes…extHostTunnelService.test|title=ExtHostTunnelService loadConnectionTable|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/node/extHostTunnelService.test|title=ExtHostTunnelService loadConnectionTable|occurrence=1extHostTunnelService.tes…extHostTunnelService.test|title=ExtHostTunnelService loadListeningPorts|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/node/extHostTunnelService.test|title=ExtHostTunnelService loadListeningPorts|occurrence=1extHostTunnelService.tes…extHostTunnelService.test|title=ExtHostTunnelService parseIpAddress|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/node/extHostTunnelService.test|title=ExtHostTunnelService parseIpAddress|occurrence=1extHostTunnelService.tes…extHostTunnelService.test|title=ExtHostTunnelService tryFindRootPorts|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/api/test/node/extHostTunnelService.test|title=ExtHostTunnelService tryFindRootPorts|occurrence=1extHostTunnelService.tes…Focused file · src/vs/platform/remote/common/remoteSocketFactoryService.ts · 60 LOCcommon/remoteSocketFacto…

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the related-file, concept, and source links on this page while the interactive map is unavailable.

1 > /*--------------------------------------------------------------------------------------------- remoteAgentConnection.ts ×53
2 > * Copyright (c) Microsoft Corporation. All rights reserved.
3 > * Licensed under the MIT License. See License.txt in the project root for license information.
4 > *--------------------------------------------------------------------------------------------*/
5 >
6 > import { IDisposable, toDisposable } from '../../../base/common/lifecycle.js';
7 > import { ISocket } from '../../../base/parts/ipc/common/ipc.net.js';
8 > import { createDecorator } from '../../instantiation/common/instantiation.js';
9 > import { RemoteConnectionOfType, RemoteConnectionType, RemoteConnection } from './remoteAuthorityResolver.js';
10 >
11 > export const IRemoteSocketFactoryService = createDecorator<IRemoteSocketFactoryService>('remoteSocketFactoryService');
12 >
13 > export interface IRemoteSocketFactoryService {
14 > readonly _serviceBrand: undefined;
15 >
16 > /**
17 > * Register a socket factory for the given message passing type
18 > * @param type passing type to register for
19 > * @param factory function that returns the socket factory, or undefined if
20 > * it can't handle the data.
21 > */
22 > register<T extends RemoteConnectionType>(type: T, factory: ISocketFactory<T>): IDisposable;
23 >
24 > connect(connectTo: RemoteConnection, path: string, query: string, debugLabel: string): Promise<ISocket>;
25 > }
26 >
27 > export interface ISocketFactory<T extends RemoteConnectionType> {
28 > supports(connectTo: RemoteConnectionOfType<T>): boolean;
29 > connect(connectTo: RemoteConnectionOfType<T>, path: string, query: string, debugLabel: string): Promise<ISocket>;
30 > }
31 >
32 > export class RemoteSocketFactoryService implements IRemoteSocketFactoryService {
33 declare readonly _serviceBrand: undefined;
34
35 private readonly factories: { [T in RemoteConnectionType]?: ISocketFactory<T>[] } = {};
37 > public register<T extends RemoteConnectionType>(type: T, factory: ISocketFactory<T>): IDisposable {
38 this.factories[type] ??= [];
39 this.factories[type]!.push(factory);
40 return toDisposable(() => {
41 const idx = this.factories[type]?.indexOf(factory);
42 if (typeof idx === 'number' && idx >= 0) {
43 this.factories[type]?.splice(idx, 1);
44 }
45 });
46 }
48 > private getSocketFactory<T extends RemoteConnectionType>(messagePassing: RemoteConnectionOfType<T>): ISocketFactory<T> | undefined {
49 const factories = (this.factories[messagePassing.type] || []);
50 return factories.find(factory => factory.supports(messagePassing));
51 }
53 > public connect(connectTo: RemoteConnection, path: string, query: string, debugLabel: string): Promise<ISocket> {
54 const socketFactory = this.getSocketFactory(connectTo);
55 if (!socketFactory) {
56 throw new Error(`No socket factory found for ${connectTo}`);
57 }
58 return socketFactory.connect(connectTo, path, query, debugLabel);
59 }