[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.interop

How to use IPC classes in .NET (ipcclientchannel & ipcserverchannel

tony

8/1/2007 11:57:00 AM

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();
}

}