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

6. Other Named Pipes Operations

Some other operations, part of the IPC, include disconnecting, flushing and closing Named Pipes.

DisconnectNamedPipe disconnects one end of the pipe from the other. Disconnecting a server pipe allows the latter to be reused by releasing it from the client pipe. This technique is shown in Part 2 of the article where we build a multithreaded Named Pipes server.

FlushFileBuffers writes to the pipe any buffered data. It is often used in conjunction with writing operations before closing a Named Pipe.

CloseHandle is used to close a Named Pipe and release its native handle. It is important to always close a pipe after finishing working with it in order to release any related resources, therefore any Named Pipes operations should be wrapped in a try-catch-finally block and the CloseHandle method should be placed in the finally part.






.NET Named Pipes Discussion

New Thread | View Details


New Thread | View Details

 
© 2009 by Ivan Latunov. Disclaimer.