diff options
author | Lluis Sanchez Gual <lluis@novell.com> | 2010-12-23 15:41:28 +0300 |
---|---|---|
committer | Lluis Sanchez Gual <lluis@novell.com> | 2010-12-23 15:44:40 +0300 |
commit | 8665eaa4400b02a4e868124420b7b0f693fd3aab (patch) | |
tree | 2f75f2c1a404e1b5cb8e1ec91a7f0b5673c16e1b /main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest | |
parent | 7ad6deafcc80a7b16dd321b7270b0e79245c1f57 (diff) |
Don't create a new IPC channel, use the MD api to create it.
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestClientSession.cs | 8 | ||||
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestService.cs | 20 |
2 files changed, 5 insertions, 23 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestClientSession.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestClientSession.cs index a2effd337e..24e890781b 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestClientSession.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestClientSession.cs @@ -26,12 +26,10 @@ using System; using System.Diagnostics; -using System.Runtime.Remoting.Channels; +using System.Runtime.Remoting; using System.Collections; using System.Runtime.Serialization.Formatters.Binary; -using System.Runtime.Remoting; using System.IO; -using System.Runtime.Remoting.Channels.Ipc; using System.Threading; using System.Collections.Generic; @@ -52,7 +50,7 @@ namespace MonoDevelop.Components.AutoTest public void StartApplication (string file, string args) { - AutoTestService.SetupRemoting (); + MonoDevelop.Core.Execution.RemotingService.RegisterRemotingChannel (); if (file.ToLower ().EndsWith (".exe") && Path.DirectorySeparatorChar != '\\') { args = "\"" + file + "\" " + args; @@ -80,7 +78,7 @@ namespace MonoDevelop.Components.AutoTest public void AttachApplication () { - AutoTestService.SetupRemoting (); + MonoDevelop.Core.Execution.RemotingService.RegisterRemotingChannel (); string sref = File.ReadAllText (AutoTestService.SessionReferenceFile); byte[] data = Convert.FromBase64String (sref); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestService.cs index 7117cc2868..992e0d5756 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestService.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestService.cs @@ -28,9 +28,7 @@ using System; using MonoDevelop.Components.Commands; using System.IO; using System.Runtime.Serialization.Formatters.Binary; -using System.Runtime.Remoting.Channels; using System.Collections; -using System.Runtime.Remoting.Channels.Ipc; using System.Runtime.Remoting; using System.Collections.Generic; @@ -48,7 +46,7 @@ namespace MonoDevelop.Components.AutoTest string sref = Environment.GetEnvironmentVariable ("MONO_AUTOTEST_CLIENT"); if (!string.IsNullOrEmpty (sref)) { Console.WriteLine ("AutoTest service starting"); - SetupRemoting (); + MonoDevelop.Core.Execution.RemotingService.RegisterRemotingChannel (); byte[] data = Convert.FromBase64String (sref); MemoryStream ms = new MemoryStream (data); BinaryFormatter bf = new BinaryFormatter (); @@ -56,7 +54,7 @@ namespace MonoDevelop.Components.AutoTest client.Connect (manager.AttachClient (client)); } if (publishServer && !manager.IsClientConnected) { - SetupRemoting (); + MonoDevelop.Core.Execution.RemotingService.RegisterRemotingChannel (); BinaryFormatter bf = new BinaryFormatter (); ObjRef oref = RemotingServices.Marshal (manager); MemoryStream ms = new MemoryStream (); @@ -86,20 +84,6 @@ namespace MonoDevelop.Components.AutoTest if (manager.IsClientConnected) manager.NotifyEvent (eventName); } - - internal static void SetupRemoting () - { - IChannel ch = ChannelServices.GetChannel ("ipc"); - if (ch == null) { - IDictionary dict = new Hashtable (); - BinaryClientFormatterSinkProvider clientProvider = new BinaryClientFormatterSinkProvider(); - BinaryServerFormatterSinkProvider serverProvider = new BinaryServerFormatterSinkProvider(); - string unixRemotingFile = Path.GetTempFileName (); - dict ["portName"] = Path.GetFileName (unixRemotingFile); - serverProvider.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full; - ChannelServices.RegisterChannel (new IpcChannel (dict, clientProvider, serverProvider), false); - } - } } class AutoTestServiceManager: MarshalByRefObject, IAutoTestService |