How to write Visual C++.NET, Visual C#, or Visual Basic.NET code to perform inter-process communications via named pipes

Article translations Article translations
Close Close
Article ID: 2060067 - View products that this article applies to.
Expand all | Collapse all

On This Page

INTRODUCTION

This article describes an All-In-One Code Framework sample that is available for download. This code sample demonstrates how to write Visual C++.NET, Visual C#, or Visual Basic.NET code to perform inter-process communications via named pipes. 

Difficulty level

Collapse this imageExpand this image
2149311

Download information

To download this code sample, click the following link:

    


Technical overview

Named pipes are a named, one-way or duplex pipe for communication between the pipe server and one or more pipe clients. In the sample package, you can find the code of a named pipe server end and a named pipe client end. The server end creates a pipe named "\\.\pipe\SamplePipe" to perform message-based communication. The pipe supports duplex connections, so both client and server can read from and write to the pipe. The security attributes of the pipe are customized to allow Authenticated Users read and write access to a pipe, and to allow the Administrators group full access to the pipe. When the pipe is connected by a client, the server attempts to read the client's message from the pipe, and write a response. The client end connects to the named pipe "\\.\pipe\SamplePipe" for message-based duplex communications with the server end. The client writes a message to the pipe and receives the response from the pipe server after the pipe is connected.

The named pipe client ends and server ends in the Visual C++, Visual C#, or Visual Basic .NET code sample packages are completely inter-operational.

Named pipe is a mechanism for one-way or bi-directional inter-process communication (IPC) between the pipe server and one or more pipe clients in the local machine or across the computers in the intranet.

For example, CSNamedPipeServer can serve as the server end of the named pipe to be connected by CppNamedPipeClient, CSNamedPipeClient and VBNamedPipeClient. CppNamedPipeClient is able to connect to CppNamedPipeServer, CSNamedPipeServer and VBNamedPipeServer.


Note
For more information about how to create the sample application and how to deploy the sample application, see the Readme.txt file that is included in the download package.

Technology category

  • Interprocess Communications

Languages

This code sample contains the following programming languages:

Collapse this tableExpand this table
LanguageClient-side Project NameServer-side Project Name
Visual C++.NETCppNamedPipeClientCppNamedPipeServer
Visual C#CSNamedPipeClientCSNamedPipeServer
Visual Basic.NETVBNamedPipeClientVBNamedPipeServer

Prerequisites

  • This sample application was created by using Visual Studio 2008 with Service Pack 1 installed.

Tags

  • IPC, Named Pipe

MORE INFORMATION

What is All-In-One Code Framework?

All-In-One Code Framework shows most Microsoft development techniques by using code samples in different programming languages. Each example is carefully selected, composed, and documented to show one common code scenario. For more information about All-In-One Code Framework, visit the following Web site:
http://1code.codeplex.com

How to find more All-In-One Code Framework samples

To find more All-In-One Code Framework samples, you can simply click the following link:
http://support.microsoft.com/gp/gp_kbcodefx

REFERENCES

For more information, visit the following Web sites:

http://msdn.microsoft.com/en-us/library/aa365574(VS.85).aspx#base.using_pipes_for_ipc
http://msdn.microsoft.com/en-us/library/aa365588.aspx
http://msdn.microsoft.com/en-us/library/system.io.pipes.aspx
http://msdn.microsoft.com/en-us/library/bb546085.aspx
Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.

Properties

Article ID: 2060067 - Last Review: July 20, 2010 - Revision: 3.0
APPLIES TO
  • Microsoft Visual Studio 2008 Service Pack 1
Keywords: 
kbcodefx kbinfo kbrapidpub kbnomt atdownload kbsurveynew KB2060067

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com