SlideShare a Scribd company logo
1 of 43
Interprocess
           Communication
                (IPC)
                 For Windows




Muhamad Hesham
9-JAN-2012
Agenda
•   Choosing IPC method criteria
•   Windows provided IPC mechanisms
•   Pipes
•   Mailslots
Choosing IPC Method Criteria
 • Communication Scope




Local or over Networks ?
Choosing IPC Method Criteria
 • Communication Scope
 • Communicating parties compatibility




16-bit Windows, UNIX, etc…
Choosing IPC Method Criteria
 • Communication Scope
 • Communicating parties compatibility
 • Locating the other party




User driven or implicitly ?
Choosing IPC Method Criteria
 •   Communication Scope
 •   Communicating parties compatibility
 •   Locating the other party
 •   Performance requirements




All IPC methods have performance overhead! But …
Choosing IPC Method Criteria
 •   Communication Scope
 •   Communicating parties compatibility
 •   Locating the other party
 •   Performance requirements
 •   Application type




GUI, console, windows service, etc…
Windows Provided IPC Mechanisms
 •   Clipboard
 •   Data Copy
 •   File Mapping
 •   RPC
 •   Windows Sockets
 •   Pipes
 •   Mailslots
 •   And others



OMG! Did MS test all these?!
Windows Provided IPC Mechanisms
• Clipboard           • All applications have access to the
• Data Copy             clipboard
•   File Mapping      • User-driven method used in: Cut,
•   RPC
                        Copy and Paste operations
•   Windows Sockets
•   Pipes
•   Mailslots
Windows Provided IPC Mechanisms
• Clipboard           Use WM_COPYDATA message to pass data to
                         another application.
• Data Copy
• File Mapping        The following structure is passed to the received
•   RPC                  application as read-only data:
•   Windows Sockets   typedef struct tagCOPYDATASTRUCT {
•   Pipes                ULONG_PTR dwData;
•   Mailslots             DWORD         cbData;
                          PVOID         lpData;
                      } COPYDATASTRUCT, *PCOPYDATASTRUCT;
Windows Provided IPC Mechanisms
• Clipboard           Sender A:
                      COPYDATASTRUCT myCopyData;
• Data Copy
                      // Initialize myCopyData
• File Mapping
                      SendMessage( hwndOther, WM_COPYDATA,
•   RPC                  (WPARAM)(HWND) hwndSelf, (LPARAM)
•   Windows Sockets      (LPVOID) &myCopyData);
•   Pipes
•   Mailslots         Receiver B:
                      case WM_COPYDATA:
                      pMyCopyData = (PCOPYDATASTRUCT)lParam;
                      switch(pMyCopyData->dwData)
                      {
                         case ID_FOO: Foo(pMyCopyData->lpData);
                         …
                      }
Windows Provided IPC Mechanisms
•   Clipboard         Four possible methods of implementing a program to
• Data Copy              reverse the order of all the bytes in a file:
                      Method 1: One File, One Buffer
• File Mapping        Method 2: Two Files, One Buffer
• RPC                 Method 3: One File, Two Buffers
•   Windows Sockets   Method 4: …
•   Pipes
•   Mailslots
Windows Provided IPC Mechanisms
•   Clipboard         Implementing a program to reverse the order of all the
• Data Copy              bytes in a file:
                      Method 1: One File, One Buffer
• File Mapping        Method 2: Two Files, One Buffer
• RPC                 Method 3: One File, Two Buffers
•   Windows Sockets   Method 4: One File, Zero Buffers
•   Pipes
•   Mailslots
Windows Provided IPC Mechanisms
 •   Clipboard         Implementing a program to reverse the order of all the
 • Data Copy              bytes in a file:
                       Method 1: One File, One Buffer
 • File Mapping        Method 2: Two Files, One Buffer
 • RPC                 Method 3: One File, Two Buffers
 •   Windows Sockets   Method 4: One File, Zero Buffers
 •   Pipes             Simply call _tcsrev to reverse the data in the file
 •   Mailslots            because it is usable simply as an in-memory text
                          string!!




Power of Memory-Mapped Files
Windows Provided IPC Mechanisms
                                                    Windows Memory
•   Clipboard                        C:Data.file
                                                    Manager
• Data Copy
• File Mapping                           Map
• RPC                                    View
•   Windows Sockets                                      ….
•   Pipes
•   Mailslots                                          szBuffer

                                                         ….
                      LPTSTR szBuffer;

                      szBuffer = // Create Map View
                      _tcsrev(szBuffer);
                      // Close Map View
Windows Provided IPC Mechanisms
 •   Clipboard
 •   Data Copy
 • File Mapping
 • RPC
 • Windows Sockets
 •   Pipes
 •   Mailslots




                                       RPC Cycle


Developed as an extension to OSF RPC
Windows Provided IPC Mechanisms
•   Clipboard       • Protocol-independent interface
•   Data Copy
•   File Mapping
                    • Based on the sockets first
• RPC
                      popularized by Berkeley Software
                      Distribution (BSD) (UNIX).
• Windows Sockets
•   Pipes
•   Mailslots
Anonymous Pipes - Properties
 • Unidirectional (2 handles: read-only and write-only)




2 instances to the same pipe with different access rights
Anonymous Pipes - Properties
 • Unidirectional (2 handles: read-only and write-only)
 • Byte-stream oriented




Useful for character-based data transfer
Anonymous Pipes - Properties
 • Unidirectional (2 handles: read-only and write-only)
 • Byte-stream oriented
 • Narrow scope (related processes)




Since it is unnamed, only its handle can be shared
Anonymous Pipes - Properties
 •   Unidirectional (2 handles: read-only and write-only)
 •   Byte-stream oriented
 •   Narrow scope (related processes)
 •   Implemented with Named Pipes




Can be treated as a named pipe
Anonymous Pipes - Properties
 •   Unidirectional (2 handles: read-only and write-only)
 •   Byte-stream oriented
 •   Narrow scope (related processes)
 •   Implemented with Named Pipes
 •   Asynchronous I/O NOT supported




ReadFile/WriteFile OVERLAPPED structure is ignored
Anonymous Pipes - CreatePipe




•   Use ReadFile/WriteFile to communicate over the pipe
•   Read operation block if buffer empty
•   Write operation block if buffer full
•   Write operation does not return until the buffer is Read
Anonymous Pipes




     I/O redirection using anonymous pipes
Named Pipes - Big Picture




          Clients and Servers using Named Pipes
Named Pipes - Properties
 • Bidirectional (1 handle for read and write)




Read and Write using the same handle simultaneously
Named Pipes - Properties
 • Bidirectional (1 handle for read and write)
 • Message and Byte-stream oriented




A very big advantage over anonymous pipes
Named Pipes - Properties
 • Bidirectional (1 handle for read and write)
 • Message and Byte-stream oriented
 • Networked and local




Pipe operations are transparent to user
Named Pipes - Properties
 •   Bidirectional (1 handle for read and write)
 •   Message and Byte-stream oriented
 •   Networked and local
 •   Asynchronous I/O supported




Can perform asynchronous pipe read, write and connect
Named Pipes - CreateNamedPipe




•   [servername]pipe[pipename]
•   User provided buffer sizes is advisory
•   Buffer sizes considerations and downsides
•   Client connects using CreateFile or CalledNamedPipe
Named Pipes - Server/Client Sync
  Server says:




  Client says:




Server/Client race conditions can happen
Named Pipes - Connection Sequence
  Single-Threaded Pipe Server says:




Multithreaded pipe server use multi pipe instances
Named Pipes - Connection Sequence
   Client says:




Clients can use Mailslots to locate server pipes
Mailslots- Big Picture                                    Maislot Server (Reader)




                        Send@ *mailslotmhesham




  Maislot Client A (Writer)                               Maislot Client C (Writer)

                              Maislot Client B (Writer)

Multiple writers single reader model
Mailslots - Properties
 • Unidirectional




One way communication line, i.e Broadcasting
Mailslots - Properties
 • Bidirectional
 • Multiple readers/writers capable




Typically, one writer many readers and vice versa
Mailslots - Properties
 • Bidirectional
 • Multiple readers/writers capable
 • No reception confirmation




Writers do not hear from the readers any response
Mailslots - Properties
 •   Bidirectional
 •   Multiple readers/writers capable
 •   No reception confirmation
 •   Can be located over network domain




As well as local on the same machine
Mailslots - Properties
 •   Bidirectional
 •   Multiple readers/writers capable
 •   No reception confirmation
 •   Can be located over network domain
 •   Limited message length




MS say 424 byte! Unicode string of size 212 character
Mailslots - CreateMailSlot




• When creating a mailslot: .mailslot[mailslotname]
• When accessing a mailslot:
  [.|*|Domain|Computer]mailslot[mailslotname]
Mailslots - Example
References
•   MSDN article: Interprocess Communication
•   RPC overview blog post
•   Windows via C/C++ book 5th edition
•   Windows System Programming book 4th edition
Thanks…




                             ?
                     Questions
Muhamad Hesham
QFS Team
mhesham@criticalsites.com

More Related Content

What's hot

Interprocess Communication
Interprocess CommunicationInterprocess Communication
Interprocess CommunicationDeepak H L
 
IPC mechanisms in windows
IPC mechanisms in windowsIPC mechanisms in windows
IPC mechanisms in windowsVinoth Raj
 
Inter-Process communication using pipe in FPGA based adaptive communication
Inter-Process communication using pipe in FPGA based adaptive communicationInter-Process communication using pipe in FPGA based adaptive communication
Inter-Process communication using pipe in FPGA based adaptive communicationMayur Shah
 
Linux@assignment ppt
Linux@assignment pptLinux@assignment ppt
Linux@assignment pptRama .
 
File service architecture and network file system
File service architecture and network file systemFile service architecture and network file system
File service architecture and network file systemSukhman Kaur
 
The Linux Kernel Implementation of Pipes and FIFOs
The Linux Kernel Implementation of Pipes and FIFOsThe Linux Kernel Implementation of Pipes and FIFOs
The Linux Kernel Implementation of Pipes and FIFOsDivye Kapoor
 
unix interprocess communication
unix interprocess communicationunix interprocess communication
unix interprocess communicationguest4c9430
 
Network File System in Distributed Computing
Network File System in Distributed ComputingNetwork File System in Distributed Computing
Network File System in Distributed ComputingChandan Padalkar
 
NETWORK FILE SYSTEM
NETWORK FILE SYSTEMNETWORK FILE SYSTEM
NETWORK FILE SYSTEMRoshan Kumar
 
Linux Presentation
Linux PresentationLinux Presentation
Linux PresentationNaiyan Noor
 
Network file system (nfs)
Network file system (nfs)Network file system (nfs)
Network file system (nfs)Raghu nath
 

What's hot (20)

Interprocess Communication
Interprocess CommunicationInterprocess Communication
Interprocess Communication
 
IPC mechanisms in windows
IPC mechanisms in windowsIPC mechanisms in windows
IPC mechanisms in windows
 
Inter-Process communication using pipe in FPGA based adaptive communication
Inter-Process communication using pipe in FPGA based adaptive communicationInter-Process communication using pipe in FPGA based adaptive communication
Inter-Process communication using pipe in FPGA based adaptive communication
 
Linux@assignment ppt
Linux@assignment pptLinux@assignment ppt
Linux@assignment ppt
 
File service architecture and network file system
File service architecture and network file systemFile service architecture and network file system
File service architecture and network file system
 
Ipc
IpcIpc
Ipc
 
The Linux Kernel Implementation of Pipes and FIFOs
The Linux Kernel Implementation of Pipes and FIFOsThe Linux Kernel Implementation of Pipes and FIFOs
The Linux Kernel Implementation of Pipes and FIFOs
 
unix interprocess communication
unix interprocess communicationunix interprocess communication
unix interprocess communication
 
Ipc
IpcIpc
Ipc
 
Nfs
NfsNfs
Nfs
 
Network File System in Distributed Computing
Network File System in Distributed ComputingNetwork File System in Distributed Computing
Network File System in Distributed Computing
 
Nfs
NfsNfs
Nfs
 
NETWORK FILE SYSTEM
NETWORK FILE SYSTEMNETWORK FILE SYSTEM
NETWORK FILE SYSTEM
 
Chapter 9 names
Chapter 9 namesChapter 9 names
Chapter 9 names
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
Nfs
NfsNfs
Nfs
 
An overview of ftp
An overview of ftpAn overview of ftp
An overview of ftp
 
Application layer
Application layerApplication layer
Application layer
 
Nfs
NfsNfs
Nfs
 
Network file system (nfs)
Network file system (nfs)Network file system (nfs)
Network file system (nfs)
 

Similar to IPC Methods for Windows

Module 5 Application and presentation Layer .pptx
Module 5 Application and presentation Layer .pptxModule 5 Application and presentation Layer .pptx
Module 5 Application and presentation Layer .pptxAASTHAJAJOO
 
communication Mechanism in Client Server Model
communication Mechanism in Client Server Model communication Mechanism in Client Server Model
communication Mechanism in Client Server Model Junaid Lodhi
 
An evening with Jay Kreps; author of Apache Kafka, Samza, Voldemort & Azkaban.
An evening with Jay Kreps; author of Apache Kafka, Samza, Voldemort & Azkaban.An evening with Jay Kreps; author of Apache Kafka, Samza, Voldemort & Azkaban.
An evening with Jay Kreps; author of Apache Kafka, Samza, Voldemort & Azkaban.Data Con LA
 
Linux Inter Process Communication
Linux Inter Process CommunicationLinux Inter Process Communication
Linux Inter Process CommunicationAbhishek Sagar
 
4. Communication and Network Security
4. Communication and Network Security4. Communication and Network Security
4. Communication and Network SecuritySam Bowne
 
Debugging applications with network security tools
Debugging applications with network security toolsDebugging applications with network security tools
Debugging applications with network security toolsConFoo
 
Architecture of cash memory for engineering ch 3.pptx
Architecture of cash memory  for engineering ch 3.pptxArchitecture of cash memory  for engineering ch 3.pptx
Architecture of cash memory for engineering ch 3.pptxmagedsrhan773
 
CISSP Prep: Ch 5. Communication and Network Security (Part 1)
CISSP Prep: Ch 5. Communication and Network Security (Part 1)CISSP Prep: Ch 5. Communication and Network Security (Part 1)
CISSP Prep: Ch 5. Communication and Network Security (Part 1)Sam Bowne
 
Packet Analysis - Course Technology Computing Conference
Packet Analysis - Course Technology Computing ConferencePacket Analysis - Course Technology Computing Conference
Packet Analysis - Course Technology Computing ConferenceCengage Learning
 
09 Systems Software Programming-Network Programming.pptx
09 Systems Software Programming-Network Programming.pptx09 Systems Software Programming-Network Programming.pptx
09 Systems Software Programming-Network Programming.pptxKushalSrivastava23
 
Realtime traffic analyser
Realtime traffic analyserRealtime traffic analyser
Realtime traffic analyserAlex Moskvin
 
Monitoring MongoDB’s Engines in the Wild
Monitoring MongoDB’s Engines in the WildMonitoring MongoDB’s Engines in the Wild
Monitoring MongoDB’s Engines in the WildTim Vaillancourt
 
CNIT 121: 10 Enterprise Services
CNIT 121: 10 Enterprise ServicesCNIT 121: 10 Enterprise Services
CNIT 121: 10 Enterprise ServicesSam Bowne
 
Processes and Threads in Windows Vista
Processes and Threads in Windows VistaProcesses and Threads in Windows Vista
Processes and Threads in Windows VistaTrinh Phuc Tho
 
CNIT 152: 10 Enterprise Services
CNIT 152: 10 Enterprise ServicesCNIT 152: 10 Enterprise Services
CNIT 152: 10 Enterprise ServicesSam Bowne
 
Clients and Servers.ppt
Clients and Servers.pptClients and Servers.ppt
Clients and Servers.pptMohammed Ilyas
 
Pm ix tutorial-june2019-pub (1)
Pm ix tutorial-june2019-pub (1)Pm ix tutorial-june2019-pub (1)
Pm ix tutorial-june2019-pub (1)ewerkboy
 
Lec 01 Introduction.pptx
Lec  01 Introduction.pptxLec  01 Introduction.pptx
Lec 01 Introduction.pptxAhmadMahmood62
 
I Heart Log: Real-time Data and Apache Kafka
I Heart Log: Real-time Data and Apache KafkaI Heart Log: Real-time Data and Apache Kafka
I Heart Log: Real-time Data and Apache KafkaJay Kreps
 

Similar to IPC Methods for Windows (20)

Module 5 Application and presentation Layer .pptx
Module 5 Application and presentation Layer .pptxModule 5 Application and presentation Layer .pptx
Module 5 Application and presentation Layer .pptx
 
communication Mechanism in Client Server Model
communication Mechanism in Client Server Model communication Mechanism in Client Server Model
communication Mechanism in Client Server Model
 
An evening with Jay Kreps; author of Apache Kafka, Samza, Voldemort & Azkaban.
An evening with Jay Kreps; author of Apache Kafka, Samza, Voldemort & Azkaban.An evening with Jay Kreps; author of Apache Kafka, Samza, Voldemort & Azkaban.
An evening with Jay Kreps; author of Apache Kafka, Samza, Voldemort & Azkaban.
 
Linux Inter Process Communication
Linux Inter Process CommunicationLinux Inter Process Communication
Linux Inter Process Communication
 
4. Communication and Network Security
4. Communication and Network Security4. Communication and Network Security
4. Communication and Network Security
 
Debugging applications with network security tools
Debugging applications with network security toolsDebugging applications with network security tools
Debugging applications with network security tools
 
Architecture of cash memory for engineering ch 3.pptx
Architecture of cash memory  for engineering ch 3.pptxArchitecture of cash memory  for engineering ch 3.pptx
Architecture of cash memory for engineering ch 3.pptx
 
CISSP Prep: Ch 5. Communication and Network Security (Part 1)
CISSP Prep: Ch 5. Communication and Network Security (Part 1)CISSP Prep: Ch 5. Communication and Network Security (Part 1)
CISSP Prep: Ch 5. Communication and Network Security (Part 1)
 
Packet Analysis - Course Technology Computing Conference
Packet Analysis - Course Technology Computing ConferencePacket Analysis - Course Technology Computing Conference
Packet Analysis - Course Technology Computing Conference
 
10135 b 11
10135 b 1110135 b 11
10135 b 11
 
09 Systems Software Programming-Network Programming.pptx
09 Systems Software Programming-Network Programming.pptx09 Systems Software Programming-Network Programming.pptx
09 Systems Software Programming-Network Programming.pptx
 
Realtime traffic analyser
Realtime traffic analyserRealtime traffic analyser
Realtime traffic analyser
 
Monitoring MongoDB’s Engines in the Wild
Monitoring MongoDB’s Engines in the WildMonitoring MongoDB’s Engines in the Wild
Monitoring MongoDB’s Engines in the Wild
 
CNIT 121: 10 Enterprise Services
CNIT 121: 10 Enterprise ServicesCNIT 121: 10 Enterprise Services
CNIT 121: 10 Enterprise Services
 
Processes and Threads in Windows Vista
Processes and Threads in Windows VistaProcesses and Threads in Windows Vista
Processes and Threads in Windows Vista
 
CNIT 152: 10 Enterprise Services
CNIT 152: 10 Enterprise ServicesCNIT 152: 10 Enterprise Services
CNIT 152: 10 Enterprise Services
 
Clients and Servers.ppt
Clients and Servers.pptClients and Servers.ppt
Clients and Servers.ppt
 
Pm ix tutorial-june2019-pub (1)
Pm ix tutorial-june2019-pub (1)Pm ix tutorial-june2019-pub (1)
Pm ix tutorial-june2019-pub (1)
 
Lec 01 Introduction.pptx
Lec  01 Introduction.pptxLec  01 Introduction.pptx
Lec 01 Introduction.pptx
 
I Heart Log: Real-time Data and Apache Kafka
I Heart Log: Real-time Data and Apache KafkaI Heart Log: Real-time Data and Apache Kafka
I Heart Log: Real-time Data and Apache Kafka
 

More from Muhamad Hesham

Design Patterns Summer Course 2009-2010 - Session#4
Design Patterns Summer Course 2009-2010 - Session#4Design Patterns Summer Course 2009-2010 - Session#4
Design Patterns Summer Course 2009-2010 - Session#4Muhamad Hesham
 
Design Patterns Summer Course 2009-2010 - Session#3
Design Patterns Summer Course 2009-2010 - Session#3Design Patterns Summer Course 2009-2010 - Session#3
Design Patterns Summer Course 2009-2010 - Session#3Muhamad Hesham
 
Design Patterns Summer Course 2009-2010 - Session#2
Design Patterns Summer Course 2009-2010 - Session#2Design Patterns Summer Course 2009-2010 - Session#2
Design Patterns Summer Course 2009-2010 - Session#2Muhamad Hesham
 
Design Patterns Summer Course 2009-2010 - Session#1
Design Patterns Summer Course 2009-2010 - Session#1Design Patterns Summer Course 2009-2010 - Session#1
Design Patterns Summer Course 2009-2010 - Session#1Muhamad Hesham
 
Design Patterns Summer Course 2010-2011 - Session#1
Design Patterns Summer Course 2010-2011 - Session#1Design Patterns Summer Course 2010-2011 - Session#1
Design Patterns Summer Course 2010-2011 - Session#1Muhamad Hesham
 
Design Patterns Summer Course 2010-2011 - Session#2
Design Patterns Summer Course 2010-2011 - Session#2Design Patterns Summer Course 2010-2011 - Session#2
Design Patterns Summer Course 2010-2011 - Session#2Muhamad Hesham
 
1st Seminar- Intelligent Agent for Medium-Level Artificial Intelligence in Re...
1st Seminar- Intelligent Agent for Medium-Level Artificial Intelligence in Re...1st Seminar- Intelligent Agent for Medium-Level Artificial Intelligence in Re...
1st Seminar- Intelligent Agent for Medium-Level Artificial Intelligence in Re...Muhamad Hesham
 
[K Engine] Intorduction To Machine Planning, A Case Based Approach
[K Engine] Intorduction To Machine Planning, A Case Based Approach[K Engine] Intorduction To Machine Planning, A Case Based Approach
[K Engine] Intorduction To Machine Planning, A Case Based ApproachMuhamad Hesham
 

More from Muhamad Hesham (8)

Design Patterns Summer Course 2009-2010 - Session#4
Design Patterns Summer Course 2009-2010 - Session#4Design Patterns Summer Course 2009-2010 - Session#4
Design Patterns Summer Course 2009-2010 - Session#4
 
Design Patterns Summer Course 2009-2010 - Session#3
Design Patterns Summer Course 2009-2010 - Session#3Design Patterns Summer Course 2009-2010 - Session#3
Design Patterns Summer Course 2009-2010 - Session#3
 
Design Patterns Summer Course 2009-2010 - Session#2
Design Patterns Summer Course 2009-2010 - Session#2Design Patterns Summer Course 2009-2010 - Session#2
Design Patterns Summer Course 2009-2010 - Session#2
 
Design Patterns Summer Course 2009-2010 - Session#1
Design Patterns Summer Course 2009-2010 - Session#1Design Patterns Summer Course 2009-2010 - Session#1
Design Patterns Summer Course 2009-2010 - Session#1
 
Design Patterns Summer Course 2010-2011 - Session#1
Design Patterns Summer Course 2010-2011 - Session#1Design Patterns Summer Course 2010-2011 - Session#1
Design Patterns Summer Course 2010-2011 - Session#1
 
Design Patterns Summer Course 2010-2011 - Session#2
Design Patterns Summer Course 2010-2011 - Session#2Design Patterns Summer Course 2010-2011 - Session#2
Design Patterns Summer Course 2010-2011 - Session#2
 
1st Seminar- Intelligent Agent for Medium-Level Artificial Intelligence in Re...
1st Seminar- Intelligent Agent for Medium-Level Artificial Intelligence in Re...1st Seminar- Intelligent Agent for Medium-Level Artificial Intelligence in Re...
1st Seminar- Intelligent Agent for Medium-Level Artificial Intelligence in Re...
 
[K Engine] Intorduction To Machine Planning, A Case Based Approach
[K Engine] Intorduction To Machine Planning, A Case Based Approach[K Engine] Intorduction To Machine Planning, A Case Based Approach
[K Engine] Intorduction To Machine Planning, A Case Based Approach
 

IPC Methods for Windows

  • 1. Interprocess Communication (IPC) For Windows Muhamad Hesham 9-JAN-2012
  • 2. Agenda • Choosing IPC method criteria • Windows provided IPC mechanisms • Pipes • Mailslots
  • 3. Choosing IPC Method Criteria • Communication Scope Local or over Networks ?
  • 4. Choosing IPC Method Criteria • Communication Scope • Communicating parties compatibility 16-bit Windows, UNIX, etc…
  • 5. Choosing IPC Method Criteria • Communication Scope • Communicating parties compatibility • Locating the other party User driven or implicitly ?
  • 6. Choosing IPC Method Criteria • Communication Scope • Communicating parties compatibility • Locating the other party • Performance requirements All IPC methods have performance overhead! But …
  • 7. Choosing IPC Method Criteria • Communication Scope • Communicating parties compatibility • Locating the other party • Performance requirements • Application type GUI, console, windows service, etc…
  • 8. Windows Provided IPC Mechanisms • Clipboard • Data Copy • File Mapping • RPC • Windows Sockets • Pipes • Mailslots • And others OMG! Did MS test all these?!
  • 9. Windows Provided IPC Mechanisms • Clipboard • All applications have access to the • Data Copy clipboard • File Mapping • User-driven method used in: Cut, • RPC Copy and Paste operations • Windows Sockets • Pipes • Mailslots
  • 10. Windows Provided IPC Mechanisms • Clipboard Use WM_COPYDATA message to pass data to another application. • Data Copy • File Mapping The following structure is passed to the received • RPC application as read-only data: • Windows Sockets typedef struct tagCOPYDATASTRUCT { • Pipes ULONG_PTR dwData; • Mailslots DWORD cbData; PVOID lpData; } COPYDATASTRUCT, *PCOPYDATASTRUCT;
  • 11. Windows Provided IPC Mechanisms • Clipboard Sender A: COPYDATASTRUCT myCopyData; • Data Copy // Initialize myCopyData • File Mapping SendMessage( hwndOther, WM_COPYDATA, • RPC (WPARAM)(HWND) hwndSelf, (LPARAM) • Windows Sockets (LPVOID) &myCopyData); • Pipes • Mailslots Receiver B: case WM_COPYDATA: pMyCopyData = (PCOPYDATASTRUCT)lParam; switch(pMyCopyData->dwData) { case ID_FOO: Foo(pMyCopyData->lpData); … }
  • 12. Windows Provided IPC Mechanisms • Clipboard Four possible methods of implementing a program to • Data Copy reverse the order of all the bytes in a file: Method 1: One File, One Buffer • File Mapping Method 2: Two Files, One Buffer • RPC Method 3: One File, Two Buffers • Windows Sockets Method 4: … • Pipes • Mailslots
  • 13. Windows Provided IPC Mechanisms • Clipboard Implementing a program to reverse the order of all the • Data Copy bytes in a file: Method 1: One File, One Buffer • File Mapping Method 2: Two Files, One Buffer • RPC Method 3: One File, Two Buffers • Windows Sockets Method 4: One File, Zero Buffers • Pipes • Mailslots
  • 14. Windows Provided IPC Mechanisms • Clipboard Implementing a program to reverse the order of all the • Data Copy bytes in a file: Method 1: One File, One Buffer • File Mapping Method 2: Two Files, One Buffer • RPC Method 3: One File, Two Buffers • Windows Sockets Method 4: One File, Zero Buffers • Pipes Simply call _tcsrev to reverse the data in the file • Mailslots because it is usable simply as an in-memory text string!! Power of Memory-Mapped Files
  • 15. Windows Provided IPC Mechanisms Windows Memory • Clipboard C:Data.file Manager • Data Copy • File Mapping Map • RPC View • Windows Sockets …. • Pipes • Mailslots szBuffer …. LPTSTR szBuffer; szBuffer = // Create Map View _tcsrev(szBuffer); // Close Map View
  • 16. Windows Provided IPC Mechanisms • Clipboard • Data Copy • File Mapping • RPC • Windows Sockets • Pipes • Mailslots RPC Cycle Developed as an extension to OSF RPC
  • 17. Windows Provided IPC Mechanisms • Clipboard • Protocol-independent interface • Data Copy • File Mapping • Based on the sockets first • RPC popularized by Berkeley Software Distribution (BSD) (UNIX). • Windows Sockets • Pipes • Mailslots
  • 18. Anonymous Pipes - Properties • Unidirectional (2 handles: read-only and write-only) 2 instances to the same pipe with different access rights
  • 19. Anonymous Pipes - Properties • Unidirectional (2 handles: read-only and write-only) • Byte-stream oriented Useful for character-based data transfer
  • 20. Anonymous Pipes - Properties • Unidirectional (2 handles: read-only and write-only) • Byte-stream oriented • Narrow scope (related processes) Since it is unnamed, only its handle can be shared
  • 21. Anonymous Pipes - Properties • Unidirectional (2 handles: read-only and write-only) • Byte-stream oriented • Narrow scope (related processes) • Implemented with Named Pipes Can be treated as a named pipe
  • 22. Anonymous Pipes - Properties • Unidirectional (2 handles: read-only and write-only) • Byte-stream oriented • Narrow scope (related processes) • Implemented with Named Pipes • Asynchronous I/O NOT supported ReadFile/WriteFile OVERLAPPED structure is ignored
  • 23. Anonymous Pipes - CreatePipe • Use ReadFile/WriteFile to communicate over the pipe • Read operation block if buffer empty • Write operation block if buffer full • Write operation does not return until the buffer is Read
  • 24. Anonymous Pipes I/O redirection using anonymous pipes
  • 25. Named Pipes - Big Picture Clients and Servers using Named Pipes
  • 26. Named Pipes - Properties • Bidirectional (1 handle for read and write) Read and Write using the same handle simultaneously
  • 27. Named Pipes - Properties • Bidirectional (1 handle for read and write) • Message and Byte-stream oriented A very big advantage over anonymous pipes
  • 28. Named Pipes - Properties • Bidirectional (1 handle for read and write) • Message and Byte-stream oriented • Networked and local Pipe operations are transparent to user
  • 29. Named Pipes - Properties • Bidirectional (1 handle for read and write) • Message and Byte-stream oriented • Networked and local • Asynchronous I/O supported Can perform asynchronous pipe read, write and connect
  • 30. Named Pipes - CreateNamedPipe • [servername]pipe[pipename] • User provided buffer sizes is advisory • Buffer sizes considerations and downsides • Client connects using CreateFile or CalledNamedPipe
  • 31. Named Pipes - Server/Client Sync Server says: Client says: Server/Client race conditions can happen
  • 32. Named Pipes - Connection Sequence Single-Threaded Pipe Server says: Multithreaded pipe server use multi pipe instances
  • 33. Named Pipes - Connection Sequence Client says: Clients can use Mailslots to locate server pipes
  • 34. Mailslots- Big Picture Maislot Server (Reader) Send@ *mailslotmhesham Maislot Client A (Writer) Maislot Client C (Writer) Maislot Client B (Writer) Multiple writers single reader model
  • 35. Mailslots - Properties • Unidirectional One way communication line, i.e Broadcasting
  • 36. Mailslots - Properties • Bidirectional • Multiple readers/writers capable Typically, one writer many readers and vice versa
  • 37. Mailslots - Properties • Bidirectional • Multiple readers/writers capable • No reception confirmation Writers do not hear from the readers any response
  • 38. Mailslots - Properties • Bidirectional • Multiple readers/writers capable • No reception confirmation • Can be located over network domain As well as local on the same machine
  • 39. Mailslots - Properties • Bidirectional • Multiple readers/writers capable • No reception confirmation • Can be located over network domain • Limited message length MS say 424 byte! Unicode string of size 212 character
  • 40. Mailslots - CreateMailSlot • When creating a mailslot: .mailslot[mailslotname] • When accessing a mailslot: [.|*|Domain|Computer]mailslot[mailslotname]
  • 42. References • MSDN article: Interprocess Communication • RPC overview blog post • Windows via C/C++ book 5th edition • Windows System Programming book 4th edition
  • 43. Thanks… ? Questions Muhamad Hesham QFS Team mhesham@criticalsites.com

Editor's Notes

  1. After you decide that your application would benefit from IPC, you must decide which of the available IPC methods to use. It is likely that an application will use several IPC mechanisms. The answers to these questions determine whether an application can benefit by using one or more IPC mechanisms.Should the application be able to communicate with other applications running on other computers on a network, or is it sufficient for the application to communicate only with applications on the local computer?
  2. Should the application be able to communicate with applications running on other computers that may be running under different operating systems (such as 16-bit Windows or UNIX)?
  3. Should the user of the application have to choose the other applications with which the application communicates, or can the application implicitly find its cooperating partners?
  4. Is performance a critical aspect of the application? All IPC mechanisms include some amount of overhead.
  5. Should the application be a GUI application or a console application? Some IPC mechanisms require a GUI application.
  6. The following IPC mechanisms are supported by Windows:ClipboardCOMData CopyDDEFile MappingMailslotsPipesRPCWindows Sockets
  7. The clipboard is a set of functions and messages that enable applications to transfer data. Because all applications have access to the clipboard, data can be easily transferred between applications or within an application.The clipboard is user-driven. A window should transfer data to or from the clipboard only in response to a command from the user. A window must not use the clipboard to transfer data without the user's knowledge.
  8. Data copy enables an application to send information to another application using the WM_COPYDATA message. This method requires cooperation between the sending application and the receiving application. The receiving application must know the format of the information and be able to identify the sender. The sending application cannot modify the memory referenced by any pointers.
  9. Data copy enables an application to send information to another application using the WM_COPYDATA message. This method requires cooperation between the sending application and the receiving application. The receiving application must know the format of the information and be able to identify the sender. The sending application cannot modify the memory referenced by any pointers.
  10. File mapping enables a process to treat the contents of a file as if they were a block of memory in the process's address space. The process can use simple pointer operations to examine and modify the contents of the file. When two or more processes access the same file mapping, each process receives a pointer to memory in its own address space that it can use to read or modify the contents of the file. The processes must use a synchronization object, such as a semaphore, to prevent data corruption in a multitasking environment.You can use a special case of file mapping to provide named shared memory between processes. If you specify the system swapping file when creating a file-mapping object, the file-mapping object is treated as a shared memory block. Other processes can access the same block of memory by opening the same file-mapping object.File mapping is quite efficient and also provides operating-system–supported security attributes that can help prevent unauthorized data corruption. File mapping can be used only between processes on a local computer; it cannot be used over a network.Key Point:  File mapping is an efficient way for two or more processes on the same computer to share data, but you must provide synchronization between the processes. For more information, see File Mapping and Synchronization.
  11. File mapping enables a process to treat the contents of a file as if they were a block of memory in the process's address space. The process can use simple pointer operations to examine and modify the contents of the file. When two or more processes access the same file mapping, each process receives a pointer to memory in its own address space that it can use to read or modify the contents of the file. The processes must use a synchronization object, such as a semaphore, to prevent data corruption in a multitasking environment.You can use a special case of file mapping to provide named shared memory between processes. If you specify the system swapping file when creating a file-mapping object, the file-mapping object is treated as a shared memory block. Other processes can access the same block of memory by opening the same file-mapping object.File mapping is quite efficient and also provides operating-system–supported security attributes that can help prevent unauthorized data corruption. File mapping can be used only between processes on a local computer; it cannot be used over a network.Key Point:  File mapping is an efficient way for two or more processes on the same computer to share data, but you must provide synchronization between the processes. For more information, see File Mapping and Synchronization.
  12. File mapping enables a process to treat the contents of a file as if they were a block of memory in the process's address space. The process can use simple pointer operations to examine and modify the contents of the file. When two or more processes access the same file mapping, each process receives a pointer to memory in its own address space that it can use to read or modify the contents of the file. The processes must use a synchronization object, such as a semaphore, to prevent data corruption in a multitasking environment.You can use a special case of file mapping to provide named shared memory between processes. If you specify the system swapping file when creating a file-mapping object, the file-mapping object is treated as a shared memory block. Other processes can access the same block of memory by opening the same file-mapping object.File mapping is quite efficient and also provides operating-system–supported security attributes that can help prevent unauthorized data corruption. File mapping can be used only between processes on a local computer; it cannot be used over a network.Key Point:  File mapping is an efficient way for two or more processes on the same computer to share data, but you must provide synchronization between the processes. For more information, see File Mapping and Synchronization.
  13. File mapping enables a process to treat the contents of a file as if they were a block of memory in the process's address space. The process can use simple pointer operations to examine and modify the contents of the file. When two or more processes access the same file mapping, each process receives a pointer to memory in its own address space that it can use to read or modify the contents of the file. The processes must use a synchronization object, such as a semaphore, to prevent data corruption in a multitasking environment.You can use a special case of file mapping to provide named shared memory between processes. If you specify the system swapping file when creating a file-mapping object, the file-mapping object is treated as a shared memory block. Other processes can access the same block of memory by opening the same file-mapping object.File mapping is quite efficient and also provides operating-system–supported security attributes that can help prevent unauthorized data corruption. File mapping can be used only between processes on a local computer; it cannot be used over a network.Key Point:  File mapping is an efficient way for two or more processes on the same computer to share data, but you must provide synchronization between the processes. For more information, see File Mapping and Synchronization.
  14. RPC enables applications to call functions remotely. Therefore, RPC makes IPC as easy as calling a function. RPC operates between processes on a single computer or on different computers on a network.The RPC provided by Windows is compliant with the Open Software Foundation (OSF) Distributed Computing Environment (DCE). This means that applications that use RPC are able to communicate with applications running with other operating systems that support DCE. RPC automatically supports data conversion to account for different hardware architectures and for byte-ordering between dissimilar environments.RPC clients and servers are tightly coupled but still maintain high performance. The system makes extensive use of RPC to facilitate a client/server relationship between different parts of the operating system.Key Point:  RPC is a function-level interface, with support for automatic data conversion and for communications with other operating systems. Using RPC, you can create high-performance, tightly coupled distributed applications. For more information, see Microsoft RPC Components.
  15. Windows Sockets is a protocol-independent interface. It takes advantage of the communication capabilities of the underlying protocols. In Windows Sockets 2, a socket handle can optionally be used as a file handle with the standard file I/O functions.Windows Sockets are based on the sockets first popularized by Berkeley Software Distribution (BSD). An application that uses Windows Sockets can communicate with other socket implementation on other types of systems. However, not all transport service providers support all available options.Key Point:  Windows Sockets is a protocol-independent interface capable of supporting current and emerging networking capabilities. For more information, see Windows Sockets 2.
  16. There are two types of pipes for two-way communication: anonymous pipes and named pipes. Anonymous pipes enable related processes to transfer information to each other. Typically, an anonymous pipe is used for redirecting the standard input or output of a child process so that it can exchange data with its parent process. To exchange data in both directions (duplex operation), you must create two anonymous pipes. The parent process writes data to one pipe using its write handle, while the child process reads the data from that pipe using its read handle. Similarly, the child process writes data to the other pipe and the parent process reads from it. Anonymous pipes cannot be used over a network, nor can they be used between unrelated processes.Named pipes are used to transfer data between processes that are not related processes and between processes on different computers. Typically, a named-pipe server process creates a named pipe with a well-known name or a name that is to be communicated to its clients. A named-pipe client process that knows the name of the pipe can open its other end, subject to access restrictions specified by named-pipe server process. After both the server and client have connected to the pipe, they can exchange data by performing read and write operations on the pipe.Key Point:  Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the same computer. Named pipes provide a simple programming interface for transferring data between two processes, whether they reside on the same computer or over a network. For more information, see Pipes.
  17. There are two types of pipes for two-way communication: anonymous pipes and named pipes. Anonymous pipes enable related processes to transfer information to each other. Typically, an anonymous pipe is used for redirecting the standard input or output of a child process so that it can exchange data with its parent process. To exchange data in both directions (duplex operation), you must create two anonymous pipes. The parent process writes data to one pipe using its write handle, while the child process reads the data from that pipe using its read handle. Similarly, the child process writes data to the other pipe and the parent process reads from it. Anonymous pipes cannot be used over a network, nor can they be used between unrelated processes.Named pipes are used to transfer data between processes that are not related processes and between processes on different computers. Typically, a named-pipe server process creates a named pipe with a well-known name or a name that is to be communicated to its clients. A named-pipe client process that knows the name of the pipe can open its other end, subject to access restrictions specified by named-pipe server process. After both the server and client have connected to the pipe, they can exchange data by performing read and write operations on the pipe.Key Point:  Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the same computer. Named pipes provide a simple programming interface for transferring data between two processes, whether they reside on the same computer or over a network. For more information, see Pipes.
  18. There are two types of pipes for two-way communication: anonymous pipes and named pipes. Anonymous pipes enable related processes to transfer information to each other. Typically, an anonymous pipe is used for redirecting the standard input or output of a child process so that it can exchange data with its parent process. To exchange data in both directions (duplex operation), you must create two anonymous pipes. The parent process writes data to one pipe using its write handle, while the child process reads the data from that pipe using its read handle. Similarly, the child process writes data to the other pipe and the parent process reads from it. Anonymous pipes cannot be used over a network, nor can they be used between unrelated processes.Named pipes are used to transfer data between processes that are not related processes and between processes on different computers. Typically, a named-pipe server process creates a named pipe with a well-known name or a name that is to be communicated to its clients. A named-pipe client process that knows the name of the pipe can open its other end, subject to access restrictions specified by named-pipe server process. After both the server and client have connected to the pipe, they can exchange data by performing read and write operations on the pipe.Key Point:  Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the same computer. Named pipes provide a simple programming interface for transferring data between two processes, whether they reside on the same computer or over a network. For more information, see Pipes.
  19. There are two types of pipes for two-way communication: anonymous pipes and named pipes. Anonymous pipes enable related processes to transfer information to each other. Typically, an anonymous pipe is used for redirecting the standard input or output of a child process so that it can exchange data with its parent process. To exchange data in both directions (duplex operation), you must create two anonymous pipes. The parent process writes data to one pipe using its write handle, while the child process reads the data from that pipe using its read handle. Similarly, the child process writes data to the other pipe and the parent process reads from it. Anonymous pipes cannot be used over a network, nor can they be used between unrelated processes.Named pipes are used to transfer data between processes that are not related processes and between processes on different computers. Typically, a named-pipe server process creates a named pipe with a well-known name or a name that is to be communicated to its clients. A named-pipe client process that knows the name of the pipe can open its other end, subject to access restrictions specified by named-pipe server process. After both the server and client have connected to the pipe, they can exchange data by performing read and write operations on the pipe.Key Point:  Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the same computer. Named pipes provide a simple programming interface for transferring data between two processes, whether they reside on the same computer or over a network. For more information, see Pipes.
  20. There are two types of pipes for two-way communication: anonymous pipes and named pipes. Anonymous pipes enable related processes to transfer information to each other. Typically, an anonymous pipe is used for redirecting the standard input or output of a child process so that it can exchange data with its parent process. To exchange data in both directions (duplex operation), you must create two anonymous pipes. The parent process writes data to one pipe using its write handle, while the child process reads the data from that pipe using its read handle. Similarly, the child process writes data to the other pipe and the parent process reads from it. Anonymous pipes cannot be used over a network, nor can they be used between unrelated processes.Named pipes are used to transfer data between processes that are not related processes and between processes on different computers. Typically, a named-pipe server process creates a named pipe with a well-known name or a name that is to be communicated to its clients. A named-pipe client process that knows the name of the pipe can open its other end, subject to access restrictions specified by named-pipe server process. After both the server and client have connected to the pipe, they can exchange data by performing read and write operations on the pipe.Key Point:  Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the same computer. Named pipes provide a simple programming interface for transferring data between two processes, whether they reside on the same computer or over a network. For more information, see Pipes.
  21. There are two types of pipes for two-way communication: anonymous pipes and named pipes. Anonymous pipes enable related processes to transfer information to each other. Typically, an anonymous pipe is used for redirecting the standard input or output of a child process so that it can exchange data with its parent process. To exchange data in both directions (duplex operation), you must create two anonymous pipes. The parent process writes data to one pipe using its write handle, while the child process reads the data from that pipe using its read handle. Similarly, the child process writes data to the other pipe and the parent process reads from it. Anonymous pipes cannot be used over a network, nor can they be used between unrelated processes.Named pipes are used to transfer data between processes that are not related processes and between processes on different computers. Typically, a named-pipe server process creates a named pipe with a well-known name or a name that is to be communicated to its clients. A named-pipe client process that knows the name of the pipe can open its other end, subject to access restrictions specified by named-pipe server process. After both the server and client have connected to the pipe, they can exchange data by performing read and write operations on the pipe.Key Point:  Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the same computer. Named pipes provide a simple programming interface for transferring data between two processes, whether they reside on the same computer or over a network. For more information, see Pipes.
  22. There are two types of pipes for two-way communication: anonymous pipes and named pipes. Anonymous pipes enable related processes to transfer information to each other. Typically, an anonymous pipe is used for redirecting the standard input or output of a child process so that it can exchange data with its parent process. To exchange data in both directions (duplex operation), you must create two anonymous pipes. The parent process writes data to one pipe using its write handle, while the child process reads the data from that pipe using its read handle. Similarly, the child process writes data to the other pipe and the parent process reads from it. Anonymous pipes cannot be used over a network, nor can they be used between unrelated processes.Named pipes are used to transfer data between processes that are not related processes and between processes on different computers. Typically, a named-pipe server process creates a named pipe with a well-known name or a name that is to be communicated to its clients. A named-pipe client process that knows the name of the pipe can open its other end, subject to access restrictions specified by named-pipe server process. After both the server and client have connected to the pipe, they can exchange data by performing read and write operations on the pipe.Key Point:  Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the same computer. Named pipes provide a simple programming interface for transferring data between two processes, whether they reside on the same computer or over a network. For more information, see Pipes.
  23. There are two types of pipes for two-way communication: anonymous pipes and named pipes. Anonymous pipes enable related processes to transfer information to each other. Typically, an anonymous pipe is used for redirecting the standard input or output of a child process so that it can exchange data with its parent process. To exchange data in both directions (duplex operation), you must create two anonymous pipes. The parent process writes data to one pipe using its write handle, while the child process reads the data from that pipe using its read handle. Similarly, the child process writes data to the other pipe and the parent process reads from it. Anonymous pipes cannot be used over a network, nor can they be used between unrelated processes.Named pipes are used to transfer data between processes that are not related processes and between processes on different computers. Typically, a named-pipe server process creates a named pipe with a well-known name or a name that is to be communicated to its clients. A named-pipe client process that knows the name of the pipe can open its other end, subject to access restrictions specified by named-pipe server process. After both the server and client have connected to the pipe, they can exchange data by performing read and write operations on the pipe.Key Point:  Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the same computer. Named pipes provide a simple programming interface for transferring data between two processes, whether they reside on the same computer or over a network. For more information, see Pipes.
  24. There are two types of pipes for two-way communication: anonymous pipes and named pipes. Anonymous pipes enable related processes to transfer information to each other. Typically, an anonymous pipe is used for redirecting the standard input or output of a child process so that it can exchange data with its parent process. To exchange data in both directions (duplex operation), you must create two anonymous pipes. The parent process writes data to one pipe using its write handle, while the child process reads the data from that pipe using its read handle. Similarly, the child process writes data to the other pipe and the parent process reads from it. Anonymous pipes cannot be used over a network, nor can they be used between unrelated processes.Named pipes are used to transfer data between processes that are not related processes and between processes on different computers. Typically, a named-pipe server process creates a named pipe with a well-known name or a name that is to be communicated to its clients. A named-pipe client process that knows the name of the pipe can open its other end, subject to access restrictions specified by named-pipe server process. After both the server and client have connected to the pipe, they can exchange data by performing read and write operations on the pipe.Key Point:  Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the same computer. Named pipes provide a simple programming interface for transferring data between two processes, whether they reside on the same computer or over a network. For more information, see Pipes.
  25. There are two types of pipes for two-way communication: anonymous pipes and named pipes. Anonymous pipes enable related processes to transfer information to each other. Typically, an anonymous pipe is used for redirecting the standard input or output of a child process so that it can exchange data with its parent process. To exchange data in both directions (duplex operation), you must create two anonymous pipes. The parent process writes data to one pipe using its write handle, while the child process reads the data from that pipe using its read handle. Similarly, the child process writes data to the other pipe and the parent process reads from it. Anonymous pipes cannot be used over a network, nor can they be used between unrelated processes.Named pipes are used to transfer data between processes that are not related processes and between processes on different computers. Typically, a named-pipe server process creates a named pipe with a well-known name or a name that is to be communicated to its clients. A named-pipe client process that knows the name of the pipe can open its other end, subject to access restrictions specified by named-pipe server process. After both the server and client have connected to the pipe, they can exchange data by performing read and write operations on the pipe.Key Point:  Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the same computer. Named pipes provide a simple programming interface for transferring data between two processes, whether they reside on the same computer or over a network. For more information, see Pipes.
  26. There are two types of pipes for two-way communication: anonymous pipes and named pipes. Anonymous pipes enable related processes to transfer information to each other. Typically, an anonymous pipe is used for redirecting the standard input or output of a child process so that it can exchange data with its parent process. To exchange data in both directions (duplex operation), you must create two anonymous pipes. The parent process writes data to one pipe using its write handle, while the child process reads the data from that pipe using its read handle. Similarly, the child process writes data to the other pipe and the parent process reads from it. Anonymous pipes cannot be used over a network, nor can they be used between unrelated processes.Named pipes are used to transfer data between processes that are not related processes and between processes on different computers. Typically, a named-pipe server process creates a named pipe with a well-known name or a name that is to be communicated to its clients. A named-pipe client process that knows the name of the pipe can open its other end, subject to access restrictions specified by named-pipe server process. After both the server and client have connected to the pipe, they can exchange data by performing read and write operations on the pipe.Key Point:  Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the same computer. Named pipes provide a simple programming interface for transferring data between two processes, whether they reside on the same computer or over a network. For more information, see Pipes.
  27. There are two types of pipes for two-way communication: anonymous pipes and named pipes. Anonymous pipes enable related processes to transfer information to each other. Typically, an anonymous pipe is used for redirecting the standard input or output of a child process so that it can exchange data with its parent process. To exchange data in both directions (duplex operation), you must create two anonymous pipes. The parent process writes data to one pipe using its write handle, while the child process reads the data from that pipe using its read handle. Similarly, the child process writes data to the other pipe and the parent process reads from it. Anonymous pipes cannot be used over a network, nor can they be used between unrelated processes.Named pipes are used to transfer data between processes that are not related processes and between processes on different computers. Typically, a named-pipe server process creates a named pipe with a well-known name or a name that is to be communicated to its clients. A named-pipe client process that knows the name of the pipe can open its other end, subject to access restrictions specified by named-pipe server process. After both the server and client have connected to the pipe, they can exchange data by performing read and write operations on the pipe.Key Point:  Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the same computer. Named pipes provide a simple programming interface for transferring data between two processes, whether they reside on the same computer or over a network. For more information, see Pipes.
  28. There are two types of pipes for two-way communication: anonymous pipes and named pipes. Anonymous pipes enable related processes to transfer information to each other. Typically, an anonymous pipe is used for redirecting the standard input or output of a child process so that it can exchange data with its parent process. To exchange data in both directions (duplex operation), you must create two anonymous pipes. The parent process writes data to one pipe using its write handle, while the child process reads the data from that pipe using its read handle. Similarly, the child process writes data to the other pipe and the parent process reads from it. Anonymous pipes cannot be used over a network, nor can they be used between unrelated processes.Named pipes are used to transfer data between processes that are not related processes and between processes on different computers. Typically, a named-pipe server process creates a named pipe with a well-known name or a name that is to be communicated to its clients. A named-pipe client process that knows the name of the pipe can open its other end, subject to access restrictions specified by named-pipe server process. After both the server and client have connected to the pipe, they can exchange data by performing read and write operations on the pipe.Key Point:  Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the same computer. Named pipes provide a simple programming interface for transferring data between two processes, whether they reside on the same computer or over a network. For more information, see Pipes.
  29. There are two types of pipes for two-way communication: anonymous pipes and named pipes. Anonymous pipes enable related processes to transfer information to each other. Typically, an anonymous pipe is used for redirecting the standard input or output of a child process so that it can exchange data with its parent process. To exchange data in both directions (duplex operation), you must create two anonymous pipes. The parent process writes data to one pipe using its write handle, while the child process reads the data from that pipe using its read handle. Similarly, the child process writes data to the other pipe and the parent process reads from it. Anonymous pipes cannot be used over a network, nor can they be used between unrelated processes.Named pipes are used to transfer data between processes that are not related processes and between processes on different computers. Typically, a named-pipe server process creates a named pipe with a well-known name or a name that is to be communicated to its clients. A named-pipe client process that knows the name of the pipe can open its other end, subject to access restrictions specified by named-pipe server process. After both the server and client have connected to the pipe, they can exchange data by performing read and write operations on the pipe.Key Point:  Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the same computer. Named pipes provide a simple programming interface for transferring data between two processes, whether they reside on the same computer or over a network. For more information, see Pipes.
  30. There are two types of pipes for two-way communication: anonymous pipes and named pipes. Anonymous pipes enable related processes to transfer information to each other. Typically, an anonymous pipe is used for redirecting the standard input or output of a child process so that it can exchange data with its parent process. To exchange data in both directions (duplex operation), you must create two anonymous pipes. The parent process writes data to one pipe using its write handle, while the child process reads the data from that pipe using its read handle. Similarly, the child process writes data to the other pipe and the parent process reads from it. Anonymous pipes cannot be used over a network, nor can they be used between unrelated processes.Named pipes are used to transfer data between processes that are not related processes and between processes on different computers. Typically, a named-pipe server process creates a named pipe with a well-known name or a name that is to be communicated to its clients. A named-pipe client process that knows the name of the pipe can open its other end, subject to access restrictions specified by named-pipe server process. After both the server and client have connected to the pipe, they can exchange data by performing read and write operations on the pipe.Key Point:  Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the same computer. Named pipes provide a simple programming interface for transferring data between two processes, whether they reside on the same computer or over a network. For more information, see Pipes.
  31. There are two types of pipes for two-way communication: anonymous pipes and named pipes. Anonymous pipes enable related processes to transfer information to each other. Typically, an anonymous pipe is used for redirecting the standard input or output of a child process so that it can exchange data with its parent process. To exchange data in both directions (duplex operation), you must create two anonymous pipes. The parent process writes data to one pipe using its write handle, while the child process reads the data from that pipe using its read handle. Similarly, the child process writes data to the other pipe and the parent process reads from it. Anonymous pipes cannot be used over a network, nor can they be used between unrelated processes.Named pipes are used to transfer data between processes that are not related processes and between processes on different computers. Typically, a named-pipe server process creates a named pipe with a well-known name or a name that is to be communicated to its clients. A named-pipe client process that knows the name of the pipe can open its other end, subject to access restrictions specified by named-pipe server process. After both the server and client have connected to the pipe, they can exchange data by performing read and write operations on the pipe.Key Point:  Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the same computer. Named pipes provide a simple programming interface for transferring data between two processes, whether they reside on the same computer or over a network. For more information, see Pipes.
  32. There are two types of pipes for two-way communication: anonymous pipes and named pipes. Anonymous pipes enable related processes to transfer information to each other. Typically, an anonymous pipe is used for redirecting the standard input or output of a child process so that it can exchange data with its parent process. To exchange data in both directions (duplex operation), you must create two anonymous pipes. The parent process writes data to one pipe using its write handle, while the child process reads the data from that pipe using its read handle. Similarly, the child process writes data to the other pipe and the parent process reads from it. Anonymous pipes cannot be used over a network, nor can they be used between unrelated processes.Named pipes are used to transfer data between processes that are not related processes and between processes on different computers. Typically, a named-pipe server process creates a named pipe with a well-known name or a name that is to be communicated to its clients. A named-pipe client process that knows the name of the pipe can open its other end, subject to access restrictions specified by named-pipe server process. After both the server and client have connected to the pipe, they can exchange data by performing read and write operations on the pipe.Key Point:  Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the same computer. Named pipes provide a simple programming interface for transferring data between two processes, whether they reside on the same computer or over a network. For more information, see Pipes.
  33. There are two types of pipes for two-way communication: anonymous pipes and named pipes. Anonymous pipes enable related processes to transfer information to each other. Typically, an anonymous pipe is used for redirecting the standard input or output of a child process so that it can exchange data with its parent process. To exchange data in both directions (duplex operation), you must create two anonymous pipes. The parent process writes data to one pipe using its write handle, while the child process reads the data from that pipe using its read handle. Similarly, the child process writes data to the other pipe and the parent process reads from it. Anonymous pipes cannot be used over a network, nor can they be used between unrelated processes.Named pipes are used to transfer data between processes that are not related processes and between processes on different computers. Typically, a named-pipe server process creates a named pipe with a well-known name or a name that is to be communicated to its clients. A named-pipe client process that knows the name of the pipe can open its other end, subject to access restrictions specified by named-pipe server process. After both the server and client have connected to the pipe, they can exchange data by performing read and write operations on the pipe.Key Point:  Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the same computer. Named pipes provide a simple programming interface for transferring data between two processes, whether they reside on the same computer or over a network. For more information, see Pipes.
  34. There are two types of pipes for two-way communication: anonymous pipes and named pipes. Anonymous pipes enable related processes to transfer information to each other. Typically, an anonymous pipe is used for redirecting the standard input or output of a child process so that it can exchange data with its parent process. To exchange data in both directions (duplex operation), you must create two anonymous pipes. The parent process writes data to one pipe using its write handle, while the child process reads the data from that pipe using its read handle. Similarly, the child process writes data to the other pipe and the parent process reads from it. Anonymous pipes cannot be used over a network, nor can they be used between unrelated processes.Named pipes are used to transfer data between processes that are not related processes and between processes on different computers. Typically, a named-pipe server process creates a named pipe with a well-known name or a name that is to be communicated to its clients. A named-pipe client process that knows the name of the pipe can open its other end, subject to access restrictions specified by named-pipe server process. After both the server and client have connected to the pipe, they can exchange data by performing read and write operations on the pipe.Key Point:  Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the same computer. Named pipes provide a simple programming interface for transferring data between two processes, whether they reside on the same computer or over a network. For more information, see Pipes.
  35. There are two types of pipes for two-way communication: anonymous pipes and named pipes. Anonymous pipes enable related processes to transfer information to each other. Typically, an anonymous pipe is used for redirecting the standard input or output of a child process so that it can exchange data with its parent process. To exchange data in both directions (duplex operation), you must create two anonymous pipes. The parent process writes data to one pipe using its write handle, while the child process reads the data from that pipe using its read handle. Similarly, the child process writes data to the other pipe and the parent process reads from it. Anonymous pipes cannot be used over a network, nor can they be used between unrelated processes.Named pipes are used to transfer data between processes that are not related processes and between processes on different computers. Typically, a named-pipe server process creates a named pipe with a well-known name or a name that is to be communicated to its clients. A named-pipe client process that knows the name of the pipe can open its other end, subject to access restrictions specified by named-pipe server process. After both the server and client have connected to the pipe, they can exchange data by performing read and write operations on the pipe.Key Point:  Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the same computer. Named pipes provide a simple programming interface for transferring data between two processes, whether they reside on the same computer or over a network. For more information, see Pipes.
  36. There are two types of pipes for two-way communication: anonymous pipes and named pipes. Anonymous pipes enable related processes to transfer information to each other. Typically, an anonymous pipe is used for redirecting the standard input or output of a child process so that it can exchange data with its parent process. To exchange data in both directions (duplex operation), you must create two anonymous pipes. The parent process writes data to one pipe using its write handle, while the child process reads the data from that pipe using its read handle. Similarly, the child process writes data to the other pipe and the parent process reads from it. Anonymous pipes cannot be used over a network, nor can they be used between unrelated processes.Named pipes are used to transfer data between processes that are not related processes and between processes on different computers. Typically, a named-pipe server process creates a named pipe with a well-known name or a name that is to be communicated to its clients. A named-pipe client process that knows the name of the pipe can open its other end, subject to access restrictions specified by named-pipe server process. After both the server and client have connected to the pipe, they can exchange data by performing read and write operations on the pipe.Key Point:  Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the same computer. Named pipes provide a simple programming interface for transferring data between two processes, whether they reside on the same computer or over a network. For more information, see Pipes.
  37. There are two types of pipes for two-way communication: anonymous pipes and named pipes. Anonymous pipes enable related processes to transfer information to each other. Typically, an anonymous pipe is used for redirecting the standard input or output of a child process so that it can exchange data with its parent process. To exchange data in both directions (duplex operation), you must create two anonymous pipes. The parent process writes data to one pipe using its write handle, while the child process reads the data from that pipe using its read handle. Similarly, the child process writes data to the other pipe and the parent process reads from it. Anonymous pipes cannot be used over a network, nor can they be used between unrelated processes.Named pipes are used to transfer data between processes that are not related processes and between processes on different computers. Typically, a named-pipe server process creates a named pipe with a well-known name or a name that is to be communicated to its clients. A named-pipe client process that knows the name of the pipe can open its other end, subject to access restrictions specified by named-pipe server process. After both the server and client have connected to the pipe, they can exchange data by performing read and write operations on the pipe.Key Point:  Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the same computer. Named pipes provide a simple programming interface for transferring data between two processes, whether they reside on the same computer or over a network. For more information, see Pipes.
  38. There are two types of pipes for two-way communication: anonymous pipes and named pipes. Anonymous pipes enable related processes to transfer information to each other. Typically, an anonymous pipe is used for redirecting the standard input or output of a child process so that it can exchange data with its parent process. To exchange data in both directions (duplex operation), you must create two anonymous pipes. The parent process writes data to one pipe using its write handle, while the child process reads the data from that pipe using its read handle. Similarly, the child process writes data to the other pipe and the parent process reads from it. Anonymous pipes cannot be used over a network, nor can they be used between unrelated processes.Named pipes are used to transfer data between processes that are not related processes and between processes on different computers. Typically, a named-pipe server process creates a named pipe with a well-known name or a name that is to be communicated to its clients. A named-pipe client process that knows the name of the pipe can open its other end, subject to access restrictions specified by named-pipe server process. After both the server and client have connected to the pipe, they can exchange data by performing read and write operations on the pipe.Key Point:  Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the same computer. Named pipes provide a simple programming interface for transferring data between two processes, whether they reside on the same computer or over a network. For more information, see Pipes.
  39. There are two types of pipes for two-way communication: anonymous pipes and named pipes. Anonymous pipes enable related processes to transfer information to each other. Typically, an anonymous pipe is used for redirecting the standard input or output of a child process so that it can exchange data with its parent process. To exchange data in both directions (duplex operation), you must create two anonymous pipes. The parent process writes data to one pipe using its write handle, while the child process reads the data from that pipe using its read handle. Similarly, the child process writes data to the other pipe and the parent process reads from it. Anonymous pipes cannot be used over a network, nor can they be used between unrelated processes.Named pipes are used to transfer data between processes that are not related processes and between processes on different computers. Typically, a named-pipe server process creates a named pipe with a well-known name or a name that is to be communicated to its clients. A named-pipe client process that knows the name of the pipe can open its other end, subject to access restrictions specified by named-pipe server process. After both the server and client have connected to the pipe, they can exchange data by performing read and write operations on the pipe.Key Point:  Anonymous pipes provide an efficient way to redirect standard input or output to child processes on the same computer. Named pipes provide a simple programming interface for transferring data between two processes, whether they reside on the same computer or over a network. For more information, see Pipes.