[Monodevelop-patches-list] r2715 - in trunk/MonoDevelop/Core/src/Tools/mdhost: . src
Lluis Sanchez <lluis@ximian.com>
lluis at mono-cvs.ximian.com
Mon Aug 8 07:40:31 EDT 2005
Author: lluis
Date: 2005-08-08 07:40:31 -0400 (Mon, 08 Aug 2005)
New Revision: 2715
Added:
trunk/MonoDevelop/Core/src/Tools/mdhost/ChangeLog
Modified:
trunk/MonoDevelop/Core/src/Tools/mdhost/src/mdhost.cs
Log:
2005-08-08 Lluis Sanchez Gual <lluis at novell.com>
* src/mdhost.cs: Use an internal tcp channel for communication with
host. Get the host object reference from the standard input. Make
sure the ProcessHost's lease does not expire.
Added: trunk/MonoDevelop/Core/src/Tools/mdhost/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/Tools/mdhost/ChangeLog 2005-08-08 11:40:09 UTC (rev 2714)
+++ trunk/MonoDevelop/Core/src/Tools/mdhost/ChangeLog 2005-08-08 11:40:31 UTC (rev 2715)
@@ -0,0 +1,5 @@
+2005-08-08 Lluis Sanchez Gual <lluis at novell.com>
+
+ * src/mdhost.cs: Use an internal tcp channel for communication with
+ host. Get the host object reference from the standard input. Make
+ sure the ProcessHost's lease does not expire.
Modified: trunk/MonoDevelop/Core/src/Tools/mdhost/src/mdhost.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Tools/mdhost/src/mdhost.cs 2005-08-08 11:40:09 UTC (rev 2714)
+++ trunk/MonoDevelop/Core/src/Tools/mdhost/src/mdhost.cs 2005-08-08 11:40:31 UTC (rev 2715)
@@ -36,19 +36,20 @@
using System.Runtime.Serialization.Formatters.Binary;
using System.Runtime.Remoting.Lifetime;
using System.Reflection;
+using System.Collections;
public class MonoDevelopProcessHost
{
public static int Main (string[] args)
{
- if (args.Length == 0) {
- Console.WriteLine ("This application is for MonoDevelop internal use only.");
- return 0;
- }
try {
- ChannelServices.RegisterChannel (new TcpChannel (0));
+ Hashtable props = new Hashtable ();
+ props ["port"] = 0;
+ props ["name"] = "__internal_tcp";
+ ChannelServices.RegisterChannel (new TcpChannel (props, null, null));
- byte[] data = Convert.FromBase64String (args [0]);
+ string sref = Console.In.ReadLine ();
+ byte[] data = Convert.FromBase64String (sref);
MemoryStream ms = new MemoryStream (data);
BinaryFormatter bf = new BinaryFormatter ();
IProcessHostController pc = (IProcessHostController) bf.Deserialize (ms);
@@ -89,9 +90,13 @@
public RemoteProcessObject CreateInstance (string fullTypeName)
{
- Type t = Type.GetType (fullTypeName);
- if (t == null) throw new InvalidOperationException ("Type not found: " + fullTypeName);
- return CreateInstance (t);
+ try {
+ Type t = Type.GetType (fullTypeName);
+ if (t == null) throw new InvalidOperationException ("Type not found: " + fullTypeName);
+ return CreateInstance (t);
+ } catch (Exception ex) {
+ throw new InvalidOperationException ("Type not found: " + fullTypeName);
+ }
}
public RemoteProcessObject CreateInstance (string assemblyPath, string typeName)
@@ -102,7 +107,7 @@
return CreateInstance (t);
}
- TimeSpan ISponsor.Renewal (ILease lease)
+ public TimeSpan Renewal (ILease lease)
{
return TimeSpan.FromSeconds (7);
}
@@ -113,4 +118,9 @@
ILease lease = mbr.GetLifetimeService () as ILease;
lease.Unregister (this);
}
+
+ public override object InitializeLifetimeService ()
+ {
+ return null;
+ }
}
More information about the Monodevelop-patches-list
mailing list