@@ -61,7 +61,7 @@ import { ExtensionEnvironmentChannel, FileProviderChannel, NodeProxyService } fr
61
61
import { Connection , ExtensionHostConnection , ManagementConnection } from "vs/server/src/node/connection" ;
62
62
import { TelemetryClient } from "vs/server/src/node/insights" ;
63
63
import { getLocaleFromConfig , getNlsConfiguration } from "vs/server/src/node/nls" ;
64
- import { NodeProxyChannel } from "vs/server/src/common/nodeProxy" ;
64
+ import { NodeProxyChannel , INodeProxyService } from "vs/server/src/common/nodeProxy" ;
65
65
import { Protocol } from "vs/server/src/node/protocol" ;
66
66
import { TelemetryChannel } from "vs/server/src/common/telemetry" ;
67
67
import { UpdateService } from "vs/server/src/node/update" ;
@@ -621,6 +621,11 @@ export class MainServer extends Server {
621
621
this . _onDidClientConnect . fire ( {
622
622
protocol, onDidClientDisconnect : connection . onClose ,
623
623
} ) ;
624
+ // NOTE: We can do this because we only have one connection at a
625
+ // time but if that changes we need a way to determine which clients
626
+ // belong to a connection and dispose only those.
627
+ ( this . services . get ( INodeProxyService ) as NodeProxyService ) . _onUp . fire ( ) ;
628
+ connection . onClose ( ( ) => ( this . services . get ( INodeProxyService ) as NodeProxyService ) . _onDown . fire ( ) ) ;
624
629
} else {
625
630
const buffer = protocol . readEntireBuffer ( ) ;
626
631
connection = new ExtensionHostConnection (
@@ -695,6 +700,8 @@ export class MainServer extends Server {
695
700
const instantiationService = new InstantiationService ( this . services ) ;
696
701
const localizationService = instantiationService . createInstance ( LocalizationsService ) ;
697
702
this . services . set ( ILocalizationsService , localizationService ) ;
703
+ const proxyService = instantiationService . createInstance ( NodeProxyService ) ;
704
+ this . services . set ( INodeProxyService , proxyService ) ;
698
705
this . ipc . registerChannel ( "localizations" , new LocalizationsChannel ( localizationService ) ) ;
699
706
instantiationService . invokeFunction ( ( ) => {
700
707
instantiationService . createInstance ( LogsDataCleaner ) ;
@@ -708,7 +715,7 @@ export class MainServer extends Server {
708
715
const requestChannel = new RequestChannel ( this . services . get ( IRequestService ) as IRequestService ) ;
709
716
const telemetryChannel = new TelemetryChannel ( telemetryService ) ;
710
717
const updateChannel = new UpdateChannel ( instantiationService . createInstance ( UpdateService ) ) ;
711
- const nodeProxyChannel = new NodeProxyChannel ( instantiationService . createInstance ( NodeProxyService ) ) ;
718
+ const nodeProxyChannel = new NodeProxyChannel ( proxyService ) ;
712
719
713
720
this . ipc . registerChannel ( "extensions" , extensionsChannel ) ;
714
721
this . ipc . registerChannel ( "remoteextensionsenvironment" , extensionsEnvironmentChannel ) ;
0 commit comments