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 2

2. Pipe Connections

Pipe connections are classes that encapsulate common Named Pipes operations like creating pipes, writing and reading data and others. The AppModule.NamedPipes assembly contains a base class for pipe connections, APipeConnection, which defines the common methods for reading and writing of data.

The APipeConnection abstract class also implements the IDisposable interface through the IInterProcessConnection interface, which is intended to ensure proper cleaning of unmanaged resources, namely the native pipe handles.

There are two other pipe connection classes that inherit from APipeConnection - ClientPipeConnection and ServerPipeConnection. They override some of the methods, like Connect and Close, to provide implementation specific to the client and server Named Pipes respectively. Both ClientPipeConnection and ServerPipeConnection have destructors, which call the Dispose method to clean the unmanaged resources.

The pipe connection classes also contain a PipeHandle class, which holds the operating system native handle and the current state of the pipe connection.






.NET Named Pipes Discussion

New Thread | View Details


New Thread | View Details

 
© 2009 by Ivan Latunov. Disclaimer.