FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
Dobbs M-Dev
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
December 01, 2003

In Search of Robust, Secure IPC for .NET

(Page 4 of 7)
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
TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK