import { DebuggerCommunicationServer } from "../debuggerCommunicationServer" ; export class DebuggerCommunicationService { private currentDebuggerServer ? : DebuggerCommunicationServer ; private previousDebuggerServerToDisconnect ? : DebuggerCommunicationServer ; public setCurrentDebuggerServer ( debugServer ) { this . currentDebuggerServer = debugServer ; } public resetCurrentDebuggerServer ( ) { if ( this . currentDebuggerServer ) { this . currentDebuggerServer . closeConnection ( ) ; } this . previousDebuggerServerToDisconnect = this . currentDebuggerServer ; this . currentDebuggerServer = undefined ; } public getCurrentDebuggerServer ( ) { return this . currentDebuggerServer ; } public handleStopEvent ( ) { if ( this . previousDebuggerServerToDisconnect ) { this . previousDebuggerServerToDisconnect . disconnectFromPort ( ) ; } } }