Léa Massiot
Léa Massiot

Reputation: 2018

c++ Interprocesses communication

As P1 will start P2, I imagine P2 will know about P1 and will be able to signal it (send it a message) easily...

Can you tell me what would be the easiest approach to implement this mechanism?

The important point, for me in this post, is what is the easiest mechanism for sending a message from P2 to P1.

Using the CreateProcess() function, info. can be sent to the child process. Can this info be the "identity" of the parent process (PPID) so that the child process can send it messages?

Thank you.

Upvotes: 0

Views: 1110

Answers (2)

For the problem you have described I would use anonymous pipes for interprocess communication.

Here is a whole article on Windows IPC that you should read : https://learn.microsoft.com/en-us/windows/win32/ipc/interprocess-communications#using-pipes-for-ipc

Upvotes: 2

Koronis Neilos
Koronis Neilos

Reputation: 792

Can you tell me what would be the easiest approach to implement this mechanism?

  1. Write a program which listen for a connection (Server).
  2. Write a programm that connects to the Server (Client).
  3. Start the Server from the Client and send a message.

Upvotes: 0

Related Questions