2 // System.Runtime.Remoting.Proxies.RemotingProxy.cs
5 // Dietmar Maurer (dietmar@ximian.com)
6 // Lluis Sanchez Gual (lsg@ctv.es)
8 // (C) 2001 Ximian, Inc. http://www.ximian.com
12 using System.Reflection;
13 using System.Runtime.Remoting.Messaging;
14 using System.Runtime.Remoting.Channels;
15 using System.Runtime.CompilerServices;
18 namespace System.Runtime.Remoting.Proxies
21 public class RemotingProxy : RealProxy
23 static MethodInfo _cache_GetTypeMethod = typeof(System.Object).GetMethod("GetType");
\r
24 static MethodInfo _cache_GetHashCodeMethod = typeof(System.Object).GetMethod("GetHashCode");
\r
28 internal RemotingProxy (Type type, Identity identity) : base (type, identity)
30 _sink = identity.ClientSink;
33 public override IMessage Invoke (IMessage request)
35 MonoMethodMessage mMsg = (MonoMethodMessage) request;
37 if (mMsg.MethodBase == _cache_GetHashCodeMethod)
38 return new MethodResponse(ObjectIdentity.GetHashCode(), null, null, request as IMethodCallMessage);
\r
40 if (mMsg.MethodBase == _cache_GetTypeMethod)
41 return new MethodResponse(GetProxiedType(), null, null, request as IMethodCallMessage);
\r
43 mMsg.Uri = ObjectIdentity.ObjectUri;
44 return _sink.SyncProcessMessage (request);