当前位置: 首页>>代码示例>>C#>>正文


C# Remoting.ObjRef类代码示例

本文整理汇总了C#中System.Runtime.Remoting.ObjRef的典型用法代码示例。如果您正苦于以下问题:C# ObjRef类的具体用法?C# ObjRef怎么用?C# ObjRef使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ObjRef类属于System.Runtime.Remoting命名空间,在下文中一共展示了ObjRef类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RemoteServer

 /// <summary>
 /// Initializes a new instance of the <see cref="RemoteServer"/> class.
 /// </summary>
 public RemoteServer()
 {
     RemoteObj = new RemoteObject();
     serverchannel = new IpcChannel("localhost:15000");
     ChannelServices.RegisterChannel(serverchannel, false);
     ref1 = RemotingServices.Marshal(RemoteObj, "RemoteObject.rem");
     Console.WriteLine("ObjRef1 URI: " + ref1.URI);
     RemoteObj.ObjectSent += new ObjectSentEventHandler(OnObjectSent);
 }
开发者ID:infomaniac50,项目名称:ScriptKey,代码行数:12,代码来源:RemoteServer.cs

示例2: UnmarshaledObject

		public void UnmarshaledObject(
			object obj,
			ObjRef or
			)
		{
			Console.WriteLine(AppDomain.CurrentDomain.FriendlyName+" Unmarshaled: "+obj.GetType().FullName);
		}
开发者ID:emtees,项目名称:old-code,代码行数:7,代码来源:TrackingHandler.cs

示例3: RemotingHostServer

        public RemotingHostServer(Machine machine, int port, string name)
            : base(machine)
        {
            this.port = port;
            this.name = name;

            // TODO review this name, get machine name
            this.hostname = "localhost";

            // According to http://www.thinktecture.com/resourcearchive/net-remoting-faq/changes2003
            // in order to have ObjRef accessible from client code
            BinaryServerFormatterSinkProvider serverProv = new BinaryServerFormatterSinkProvider();
            serverProv.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full;

            BinaryClientFormatterSinkProvider clientProv = new BinaryClientFormatterSinkProvider();

            IDictionary props = new Hashtable();
            props["port"] = port;

            TcpChannel channel = new TcpChannel(props, clientProv, serverProv);

            if (!registered)
            {
                ChannelServices.RegisterChannel(channel, false);
                registered = true;
            }

            // end of "according"

            // TODO review other options to publish an object
            this.objref = RemotingServices.Marshal(this, name);
        }
开发者ID:ajlopez,项目名称:AjTalk,代码行数:32,代码来源:RemotingHostServer.cs

示例4: InitialisiereRemotableObject

 // stellt dieses Objekt via Remoting zur Verfügung
 public void InitialisiereRemotableObject()
 {
     // melde dieses Objekt unter der gegebenen URL auf dem spezifierten Pfad an
     _PortalLogikObjRef = RemotingServices.Marshal(
         this,
          this._Pfad,
         ((Object)this).GetType());
 }
开发者ID:BackupTheBerlios,项目名称:pels-svn,代码行数:9,代码来源:Cap_PortalLogik.cs

示例5: UnmarshaledObject

 // Notifies a handler that an object has been unmarshaled.
 public void UnmarshaledObject(Object obj, ObjRef or)
 {
     if (obj.GetType() != typeof(AppDomain))
         Trace.WriteLine(string.Format("Tangra Addins: Unmarshaled instance of {0} ({1} HashCode:{2})", or.TypeInfo != null ? or.TypeInfo.TypeName : obj.GetType().ToString(), or.URI != null ? or.URI.ToString() : "N/A", obj.GetHashCode().ToString()));
     else
     {
         // Not interested in AppDomain marshalling
     }
 }
开发者ID:hpavlov,项目名称:tangra3,代码行数:10,代码来源:AddinTrackingHandler.cs

示例6: ObjRef

		internal ObjRef (ObjRef o, bool unmarshalAsProxy) {
			channel_info = o.channel_info;
			uri = o.uri;
	
			typeInfo = o.typeInfo;
			envoyInfo = o.envoyInfo;
			flags = o.flags;
			if (unmarshalAsProxy) flags |= MarshalledObjectRef;
		}
开发者ID:runefs,项目名称:Marvin,代码行数:9,代码来源:ObjRef.cs

示例7: DeserializeInTheCurrentDomain

		internal ObjRef DeserializeInTheCurrentDomain (int domainId, byte[] tInfo)
		{
				string local_uri = string.Copy (this.uri);
				ChannelInfo cinfo = new ChannelInfo (new CrossAppDomainData (domainId));
				ObjRef res = new ObjRef (local_uri, cinfo);
				IRemotingTypeInfo typeInfo = (IRemotingTypeInfo)CADSerializer.DeserializeObjectSafe (tInfo);
				res.typeInfo = typeInfo;
				return res;
		}
开发者ID:Profit0004,项目名称:mono,代码行数:9,代码来源:ObjRef.cs

示例8: ObjRef

 private ObjRef(ObjRef o)
 {
     this.uri = o.uri;
     this.typeInfo = o.typeInfo;
     this.envoyInfo = o.envoyInfo;
     this.channelInfo = o.channelInfo;
     this.objrefFlags = o.objrefFlags;
     this.SetServerIdentity(o.GetServerIdentity());
     this.SetDomainID(o.GetDomainID());
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:10,代码来源:ObjRef.cs

示例9: MarshaledObject

 // Notifies a handler that an object has been marshaled.
 public void MarshaledObject(Object obj, ObjRef or)
 {
     if (obj.GetType() != typeof(AppDomain))
     {
         if (TraceSwitchAppDomainTracking.Enabled)
             Trace.WriteLine(string.Format("OccuRec: Marshaled instance of {0} ({1} HashCode:{2})", or.TypeInfo != null ? or.TypeInfo.TypeName : obj.GetType().ToString(), or.URI != null ? or.URI.ToString() : "N/A", obj.GetHashCode().ToString()));
     }
     else
     {
         // Not interested in AppDomain marshalling
     }
 }
开发者ID:hpavlov,项目名称:occurec,代码行数:13,代码来源:TrackingHandler.cs

示例10: SyncProcessMessage

 public IMessage SyncProcessMessage(IMessage msg)
 {
     IMethodMessage methodMessage = (IMethodMessage)msg;
     if (methodMessage.MethodName == ".ctor")
     {
         IMethodReturnMessage retMsg = (IMethodReturnMessage)this.NextSink.SyncProcessMessage(msg);
         _realObj = (ObjRef)retMsg.ReturnValue;
         return retMsg;
     }
     AOPBaseClass obj = (AOPBaseClass)RemotingServices.Unmarshal(_realObj);
     return obj.SyncProcessMessage(this.NextSink, msg);
 }
开发者ID:jodli,项目名称:AOP,代码行数:12,代码来源:AOPSink.cs

示例11: SyncProcessMessage

        public IMessage SyncProcessMessage(IMessage msg)
        {
            IMethodMessage methodMessage = (IMethodMessage)msg;

            if (methodMessage.MethodName == ".ctor") {
                IMethodReturnMessage ret = (IMethodReturnMessage)m_NextSink.SyncProcessMessage(msg);
                realobject = (ObjRef)ret.ReturnValue;
                return ret;
            } else {
                AOPBaseClass obj = (AOPBaseClass)RemotingServices.Unmarshal(realobject);
                return obj.SyncProcessMessage(m_NextSink, msg);
            }
        }
开发者ID:liaoyu45,项目名称:LYCodes,代码行数:13,代码来源:AOPSink.cs

示例12: NotifyMarshaledObject

		internal static void NotifyMarshaledObject(Object obj, ObjRef or)
		{
			ITrackingHandler[] handlers;
			
			lock (_handlers.SyncRoot) {
				if (_handlers.Count == 0) return;
				handlers = (ITrackingHandler[]) _handlers.ToArray (typeof(ITrackingHandler));
			}
			
			for(int i = 0; i < handlers.Length; i++) {
				handlers[i].MarshaledObject (obj, or);
			}
		}
开发者ID:jack-pappas,项目名称:mono,代码行数:13,代码来源:TrackingServices.cs

示例13: MarshaledObject

 internal static void MarshaledObject(object obj, ObjRef or)
 {
     try
     {
         ITrackingHandler[] handlerArray = _Handlers;
         for (int i = 0; i < _Size; i++)
         {
             handlerArray[i].MarshaledObject(obj, or);
         }
     }
     catch
     {
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:14,代码来源:TrackingServices.cs

示例14: SyncProcessMessage

		/// <summary>
		/// Synchronously processes the given message.
		/// </summary>
		/// <param name="msg">The message to process.</param>
		/// <returns>
		/// A reply message in response to the request.
		/// </returns>
		/// <exception cref="T:System.Security.SecurityException">
		/// The immediate caller makes the call through a reference to the interface and does not have infrastructure permission.
		/// </exception>
		public IMessage SyncProcessMessage(IMessage msg)
		{
			IMethodMessage methodMessage = (IMethodMessage)msg;
			if (methodMessage.MethodName == ".ctor")
			{
				IMethodReturnMessage ret = (IMethodReturnMessage)_nextSink.SyncProcessMessage(msg);
				_realObject = (ObjRef)ret.ReturnValue;
				return ret;
			}
			else
			{
				AspectOrientedObject obj = (AspectOrientedObject)RemotingServices.Unmarshal(_realObject);
				return obj.SyncProcessMessage(_nextSink, msg);
			}
		}
开发者ID:treytomes,项目名称:ILExperiments,代码行数:25,代码来源:AspectMessageSink.cs

示例15: JobManagerFixture

        public JobManagerFixture()
        {
            BinaryServerFormatterSinkProvider serverProv = new BinaryServerFormatterSinkProvider();
            serverProv.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full;

            System.Collections.IDictionary ClientTcpChannelProperties = new System.Collections.Hashtable();
            ClientTcpChannelProperties["name"] = "ClientTcpChan";
            ChannelServices.RegisterChannel(
                    new System.Runtime.Remoting.Channels.Tcp.TcpClientChannel(ClientTcpChannelProperties, new BinaryClientFormatterSinkProvider()), false);

            int port = 35010;

            System.Collections.IDictionary TcpChannelProperties = new System.Collections.Hashtable();
            TcpChannelProperties["port"] = port;
            try
            {
                chan = new System.Runtime.Remoting.Channels.Tcp.TcpServerChannel(TcpChannelProperties, serverProv);
                ChannelServices.RegisterChannel(chan, false);
                server = new JobServerImpl();
                serverRef = RemotingServices.Marshal(server, "JobServer");
                server.handlersAdded.Set();
            }
            catch (SocketException e)
            {
                if (!e.Message.StartsWith("Only one usage of each socket address"))
                {
                    throw;
                }
            }
        }
开发者ID:neemask,项目名称:meta-core,代码行数:30,代码来源:JobManagerFixture.cs


注:本文中的System.Runtime.Remoting.ObjRef类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。