internal override AbstractServerTransportManager GetCommandTransportManager(Guid powerShellCmdId) { lock (this.syncObject) { OutOfProcessServerTransportManager manager = null; this.cmdTransportManagers.TryGetValue(powerShellCmdId, out manager); return(manager); } }
internal void CreateCommandTransportManager(Guid powerShellCmdId) { OutOfProcessServerTransportManager transportManager = new OutOfProcessServerTransportManager(this.stdOutWriter, powerShellCmdId, this.TypeTable, this.Fragmentor.FragmentSize, this.CryptoHelper); transportManager.MigrateDataReadyEventHandlers((BaseTransportManager)this); lock (this.syncObject) this.cmdTransportManagers.Add(powerShellCmdId, transportManager); this.stdOutWriter.WriteLine(OutOfProcessUtils.CreateCommandAckPacket(powerShellCmdId)); }
internal void CreateCommandTransportManager(Guid powerShellCmdId) { OutOfProcessServerTransportManager manager = new OutOfProcessServerTransportManager(this.stdOutWriter, powerShellCmdId, base.TypeTable, base.Fragmentor.FragmentSize, base.CryptoHelper); manager.MigrateDataReadyEventHandlers(this); lock (this.syncObject) { this.cmdTransportManagers.Add(powerShellCmdId, manager); } this.stdOutWriter.WriteLine(OutOfProcessUtils.CreateCommandAckPacket(powerShellCmdId)); }
internal void CreateCommandTransportManager(Guid powerShellCmdId) { OutOfProcessServerTransportManager cmdTM = new OutOfProcessServerTransportManager(_stdOutWriter, _stdErrWriter, powerShellCmdId, this.TypeTable, this.Fragmentor.FragmentSize, this.CryptoHelper); // this will make the Session's DataReady event handler handle // the commands data as well. This is because the state machine // is per session. cmdTM.MigrateDataReadyEventHandlers(this); lock (_syncObject) { // the dictionary is cleared by ServerPowershellDataStructure handler // once the clean up is complete for the transport manager Dbg.Assert(!_cmdTransportManagers.ContainsKey(powerShellCmdId), "key already exists"); _cmdTransportManagers.Add(powerShellCmdId, cmdTM); } // send command ack..so that client can start sending data _stdOutWriter.WriteLine(OutOfProcessUtils.CreateCommandAckPacket(powerShellCmdId)); }