示例#1
0
        public IpcClient()
        {
            // Create the channel.
            IpcClientChannel channel = new IpcClientChannel();

            // Register the channel.
            ChannelServices.RegisterChannel(channel, true);

            // Get an instance of the remote object.
            RemoteObject = Activator.GetObject(typeof(IpcRemoteObject), "ipc://ipcSample/test") as IpcRemoteObject;

            Console.WriteLine(RemoteObject.URL);
            return;
        }
示例#2
0
        public IpcServer()
        {
            // Create the server channel.
            IpcServerChannel channel = new IpcServerChannel("ipcSample");

            // Register the server channel.
            ChannelServices.RegisterChannel(channel, true);

            // Create an instance of the remote object.
            RemoteObject = new IpcRemoteObject();

            RemoteObject.URL = "URL";
            RemotingServices.Marshal(RemoteObject, "test", typeof(IpcRemoteObject));
        }