How to use IPC classes in .NET (ipcclientchannel & ipcserverchannel)
I want to use ipcclientchannel & ipcserverchannel class for
interprocess communication. I refered to msdn, and the code for server
is as follows. My Question is how can I write to the Shared Object
(Counter) since I want to pass some data from server to client?
using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Ipc;
public class IpcServer
{
public static void Main ()
{
// Create and register an IPC channel
IpcServerChannel serverChannel = new
IpcServerChannel("remote");
ChannelServices.RegisterChannel(serverChannel);
// Expose an object
RemotingConfiguration.RegisterWellKnownServiceType( typeof(Counter),
"counter", WellKnownObjectMode.Singleton );
// Wait for calls
Console.WriteLine("Listening on {0}",
serverChannel.GetChannelUri());
Console.ReadLine();
}
}
Date:Wed, 01 Aug 2007 11:56:47 -0000
Author:
|