11.13. Communicate Using Named Pipes

Problem

You need to send data between two processes on the same computer (or remote computers) using a named pipes connection.

Solution

One computer (the server) must create the server using the NamedPipeServerStream class and wait for connections clients using the WaitForConnection method. Another computer (the client) establishes a connection to the server pipe by creating an instance of the NamedPipeClientStream and using the Connect method.

How It Works

A pipe represents a line of communications between two processes, which may or may not be on the same machine. These pipes come in two main forms: anonymous and named. Anonymous pipes, represented by the AnonymousPipeServerStream and AnonymousPipeClientStream ...

Get Visual Basic 2008 Recipes: A Problem-Solution Approach now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.