protocolServerHandler.ts ×6

Frontier kind: Code frontier

unlabeled · c_4cb3cda0f815

27 tests · 28478 LOC · 148 files · introduces 0 tests · 14 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges14 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
2693 ranges28478 lines · 148 files · Browse complete extent
All tests (intent)
27 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.

1 file ranked by introduced lines: 14 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/node/protocolServerHandler.ts 14 introduced LOC · 6 ranges

Open complete file

506 const record = client ? this._clients.get(client.clientId) : undefined;
507 if (client && record?.state === 'active') {
508 > const connectionIndex = record.connections.indexOf(client); protocolServerHandler.ts
509 > if (connectionIndex !== -1) {
510 > const subscriptionCount = client.subscriptions.size;
511 > record.connections.splice(connectionIndex, 1);
512 > this._releaseClientSubscriptions(client, record);
513 > this._rejectPendingReverseRequestsForConnection(client);
514 > if (record.connections.length === 0) {
515 this._logService.info(`[ProtocolServer] Client disconnected: ${client.clientId}, subscriptions=${subscriptionCount}`);
516 this._clients.set(client.clientId, { state: 'grace', lastSeenAt: Date.now(), disconnectTimeouts: new DisposableMap() });
518 this._onDidChangeConnectionCount.fire(this._connectedClientCount);
519 }
521 > }
522 disposables.dispose();
523 }));
1006
1007 private _releaseClientSubscriptions(client: IConnectedClient, record: IActiveClientRecord): void {
1008 > for (const sub of client.subscriptions.values()) { protocolServerHandler.ts
1009 if (sub.kind === ChannelKind.State) {
1010 if (this._hasSubscriptionInOtherConnection(record, client, sub.uri)) {
1016 }
1017 }
1018 > client.subscriptions.clear(); protocolServerHandler.ts
1019 > }
1020
1021 private _hasSubscriptionInOtherConnection(record: IClientRecord, client: IConnectedClient, uri: string): boolean {
1394 */
1395 private _rejectPendingReverseRequestsForConnection(client: IConnectedClient): void {
1396 > for (const [id, pending] of this._pendingReverseRequests) { protocolServerHandler.ts
1397 if (pending.client === client) {
1398 this._pendingReverseRequests.delete(id);
1400 }
1401 }
1403
1404 private _handleRequest(client: IConnectedClient, method: string, params: unknown, id: number): void {