Пример #1
1
 /// <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);
 }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RemoteClient"/> class.
 /// </summary>
 public RemoteClient()
 {
     clientchannel = new IpcChannel();
     ChannelServices.RegisterChannel(clientchannel, false);
     RemotingConfiguration.RegisterWellKnownClientType(typeof(RemoteObject), "ipc://localhost:15000/RemoteObject.rem");
     RemoteObj = new RemoteObject();
     sponser = new RemoteClientSponser("RemoteClient");
     lease = (ILease)RemoteObj.GetLifetimeService();
     lease.Register(sponser);
 }