 |
|
|
|
 |
|
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
|
|
 |