+2003-03-15 Lluis Sanchez Gual <lluis@ideary.com>
+
+ * CrossAppDomainChannel.cs: fixes bugs #39380 and #39331.
+
2003-03-03 Lluis Sanchez Gual <lluis@ideary.com>
* ChannelServices.cs: Minor corrections.
try
{
- IMessage reqDomMsg;
-
- if (null != arrRequest)
- reqDomMsg = CADSerializer.DeserializeMessage (new MemoryStream(arrRequest), null);
- else
- reqDomMsg = new MethodCall (cadMsg);
-
- IMessage retDomMsg = ChannelServices.SyncDispatchMessage (reqDomMsg);
-
- cadMrm = CADMethodReturnMessage.Create (retDomMsg);
- if (null == cadMrm) {
- arrResponse = CADSerializer.SerializeMessage (retDomMsg).GetBuffer();
- } else
- arrResponse = null;
-\r
+ AppDomain.CurrentDomain.ProcessMessageInDomain (arrRequest, cadMsg, out arrResponse, out cadMrm);
}
catch (Exception e)
{
+2003-03-15 Lluis Sanchez Gual <lluis@ideary.com>
+
+ * RemotingServices.cs: fixes bugs #39380 and #39331.
+
2003-02-25 Lluis Sanchez Gual <lluis@ideary.com>
* Identity.cs: Added property to check if an identity is connected (it is remotely accesible)
using System.Runtime.Remoting.Lifetime;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
+using System.IO;
namespace System.Runtime.Remoting
{
static RemotingServices ()
{
+ RegisterInternalChannels ();
app_id = "/" + Guid.NewGuid().ToString().Replace('-', '_') + "/";
-
CreateWellKnownServerIdentity (typeof(RemoteActivator), "RemoteActivationService.rem", WellKnownObjectMode.Singleton);
}
internal static object GetDomainProxy(AppDomain domain)
{
- ObjRef appRef = null;
-
- // Make sure that the channels is active in this domain
- RegisterInternalChannels();
+ byte[] data = null;
- // this should use contexts in the future
+ Context currentContext = Thread.CurrentContext;
AppDomain currentDomain = AppDomain.InternalSetDomain (domain);
try
{
- // Make sure that our new domain also has the internal channels
- RegisterInternalChannels();
-
- appRef = RemotingServices.Marshal(domain, null, null);
+ data = domain.GetMarshalledDomainObjRef ();
}
finally
{
AppDomain.InternalSetDomain (currentDomain);
+ AppDomain.InternalSetContext (currentContext);
}
- return (AppDomain) RemotingServices.Unmarshal(appRef);
+ MemoryStream stream = new MemoryStream (data);
+ ObjRef appref = (ObjRef) CADSerializer.DeserializeObject (stream);
+ return (AppDomain) RemotingServices.Unmarshal(appref);
}
private static void RegisterInternalChannels()
using System.Runtime.InteropServices;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Contexts;
+using System.Runtime.Remoting.Channels;
+using System.Runtime.Remoting.Messaging;
using System.Security.Principal;
using System.Security.Policy;
using System.Security;
return null;
}
+
+ internal byte[] GetMarshalledDomainObjRef ()
+ {
+ ObjRef oref = RemotingServices.Marshal(AppDomain.CurrentDomain, null, typeof(AppDomain));
+ return CADSerializer.SerializeObject (oref).GetBuffer();
+ }
+
+ internal void ProcessMessageInDomain (byte[] arrRequest, CADMethodCallMessage cadMsg, out byte[] arrResponse, out CADMethodReturnMessage cadMrm)
+ {
+ IMessage reqDomMsg;
+
+ if (null != arrRequest)
+ reqDomMsg = CADSerializer.DeserializeMessage (new MemoryStream(arrRequest), null);
+ else
+ reqDomMsg = new MethodCall (cadMsg);
+
+ IMessage retDomMsg = ChannelServices.SyncDispatchMessage (reqDomMsg);
+
+ cadMrm = CADMethodReturnMessage.Create (retDomMsg);
+ if (null == cadMrm)
+ {
+ arrResponse = CADSerializer.SerializeMessage (retDomMsg).GetBuffer();
+ }
+ else
+ arrResponse = null;
+ }
+
// End of methods called from the runtime
public event AssemblyLoadEventHandler AssemblyLoad;
+2003-03-15 Lluis Sanchez Gual <lluis@ideary.com>
+
+ * AppDomain.cs: fixes bugs #39380 and #39331.
+
2003-03-06 Nick Drochak <ndrochak@gol.com>
* TimeSpan.cs (Negate): Throw exception when value is MinValue.