ivan.web Home | About | Mailing List | Contact


 » Articles










 


Part 1
» 1. Introduction
» 2. Classes
» 3. Creating a Named Pipe
» 4. Connecting Client Pipes
» 5. Writing and Reading Data
» 6. Other Named Pipes Operations
 
Part 2
» 1. Introduction
» 2. Pipe Connections
» 3. ServerNamedPipe Class
» 4. PipeManager Class
» 5. Client Pipe Connections
 
» .NET Named Pipes Discussion

   

Inter-Process Communication in .NET Using Named Pipes, Part 1

2. Classes

Let's now look at some of the classes and methods that are part of the Named Pipes solution. Diagram 1 below shows those classes and the relationships between them.

There are several interfaces, part of the solution, such as IClientChannel and IInterProcessConnection, all compiled in the AppModule.InterProcessComm assembly. Those interfaces are introduced in order to abstract the Named Pipes implementation from clients involved in the IPC. Following the fundamental object-oriented principle of "loose coupling", our client application will use the interfaces when exchanging messages with the server, which allows the specific IPC protocol to vary if necessary.

Outlined below are the main responsibilities of the classes, part of the .NET Named Pipes solution.

  • NamedPipeNative: This utility class exposes kernel32.dll methods for Named Pipes communication. It also defines constants for some of the error codes and method parameter values.
  • NamedPipeWrapper: This class is a wrapper around NamedPipesNative. It uses the exposed kernel32.dll methods to provide controlled Named Pipes functionality.
  • APipeConnection: An abstract class, which defines the methods for creating Named Pipes connections, reading and writing data. This class is inherited by the ClientPipeConnection and ServerPipeConnection classes, used by client and server applications respectively.
  • ClientPipeConnection: Used by client applications to communicate with server ones by using Named Pipes.
  • ServerPipeConnection: Allows a Named Pipes server to create connections and exchange data with clients.
  • PipeHandle: Holds the operating system native handle and the current state of the pipe connection.

Diagram 1: Named Pipes UML static diagram






.NET Named Pipes Discussion

New Thread | View Details


New Thread | View Details

 
© 2009 by Ivan Latunov. Disclaimer.