December 01, 2003
In Search of Robust, Secure IPC for .NET
In Search of Robust, Secure IPC for .NET
Listing 1 Base class and interface definitions for IPC architecture
namespace Jitsu.Ipc
{
public interface IMessageSink
{
void AcceptMessage(byte[] payload);
}
public abstract class IpcEndpoint
{
// Create a client-side connection to the IPC endpoint.
public abstract IpcClient Connect();
// Create the server-side of an IPC endpoint, and
// begin listening for messages.
public abstract IpcServer Listen();
}
public abstract class IpcClient :
IMessageSink, IDisposable
{
// Send a message to the IPC endpoint (implements IMessageSink).
public abstract void SendMessage(byte[] payload);
// Close the client-side of the connection
// (implements IDisposable).
public abstract void Close();
}
public abstract class IpcServer : IDisposable
{
// Begin listening for messages (blocks until StopListening
// is called). Incoming messages are routed to the app's
// IMessageSink callback.
public abstract void StartListening(IMessageSink callback);
// Shuts down the IPC endpoint (implements IDisposable).
public abstract void StopListening();
} }
Previous Page |
1
|
2
|
3
|
4
|
5
|
6
|
7
Next Page