Click here to Skip to main content
15,867,939 members
Everything / IPC

IPC

IPC

Great Reads

by ThatsAlok
Simple tip and trick for Mail Slot
by ThatsAlok
IPC using memory mapped file in managed VC++
by Ben Baron
Java source code to demonstrate Executable Integration which is a concept of integrating several distinct executables to create a single application
by Paul M Watt
This is an introduction to network alchemy

Latest Articles

by pdoxtader
A simple and convenient wrapper class for Anonymous Pipes in C# using serialization.
by honey the codewitch
Diving into some of the core plumbing behind the Windows operating system
by honey the codewitch
Creating an application that can run once, but then accept command line args from subsequent runs
by Code Artist
TCP Application Protocol is an IPC (Inter-process Communication) created to provide common remote interface for between applications.

All Articles

Sort by Score

IPC 

7 Jan 2012 by ThatsAlok
Simple tip and trick for Mail Slot
5 Feb 2013 by Zoltán Zörgő
Read this comprehensive summary of the choices you have, including their performance aspects: http://msdn.microsoft.com/en-us/library/windows/desktop/aa365574(v=vs.85).aspx[^]
5 Feb 2013 by Member 661293
I'm using same Server.And Two Program(A.exe B.exe).I want process(A.exe B.exe) community.Because I'm Tested PictureBox.if A.exe PictureBox 10ms , B.exe PictureBox 10ms then...Only One Winform Program Tow PictureBox -> 30ms more...But,I can not chose Named Pipe or Shared...
20 Jan 2023 by Richard MacCutchan
If you cannot complete the task yourself then you obviously do not have the level of experience that this company is looking for. And if someone here provided you with a complete solution and you got the job - what then? When they gave you a real...
2 Sep 2010 by Smithers-Jones
I got about 90000 hits on Google when searching for "ipchain tutorial" and "ipchain howto". And so will you.
6 Dec 2010 by Manfred Rudolf Bihy
Hi Kanade,will work the same for internet. Of course the host addresses will either be IPs or something like myhost.mydomain.com. If you're going to do DCOM over the internet you might be interested in this little piece...
27 Jul 2011 by nk.dushila
Hello Fellow Programmers, I'm developing two programs in 'C'. One is for sending data and second is for receiving(not simultaneously) Using 'NamedPipes'.Here i really want to explain you that what i did in both programs: * Sending Program--> lets say server.c Here i...
27 Jul 2011 by Olivier Levrey
Did you check that page from MSDN:http://msdn.microsoft.com/en-us/library/aa365592(v=vs.85).aspx[^]
27 Jul 2011 by R. Erasmus
How about closing the input side of pipe (in server.c) before the writing to client and closing the output side of pipe (in client.c) before reading from the pipe.
27 Jul 2011 by Olivier Levrey
You shouldn't create the pipe from both client and server:For server:- call CreateNamedPipe (do not call CreateFile!!)- call ConnectNamedPipe- call ReadFile and WriteFile on the pipe handle- call DisconnectNamedPipe- call CloseHandle on the pipe handleFor client:- call...
18 Nov 2012 by Gilad Rozban
Use shared memory : it's the fastest IPC. Initialize a semaphore in the shared memory and avoid running on kernel as much as possible.
3 Mar 2015 by db7uk
Basically You need to look into the publish subscribe pattern. An excellent example is: http://www.idesign.net/Downloads#InstanceManagement[^]. Take a look at the Publish subscribe framework.Basically, host your service (publisher) somewhere (app 1 or a dedicated service) and the have your...
22 May 2013 by Jochen Arndt
You are calling WriteFile() with a pointer to an overlapped structure. This is not necessary, because the file has not been opened for overlapped I/O. The error is sourced by passing an uninitialized overlapped structure. The invalid handle error does not apply to file handle but to the...
19 Jul 2013 by ThatsAlok
IPC using memory mapped file in managed VC++
2 Oct 2015 by _SurajP
Let me rephrase the question:-Say process A and B.1. 'A' creates named shared memory (CreateFileMapping) 2. 'B' opens shared memory (OpenFileMapping)3. 'A' terminates abnormally. Or lets say it just exits properly. Consider situations in which Process A can "NOT" signal process B...
17 Aug 2016 by Richard MacCutchan
That's because the message loop in .NET is hidden from view. See Message Structure (System.Windows.Forms)[^] for a sample of how to catch messages.
26 Jun 2018 by Jochen Arndt
That is sourced by calling wait(2) - Linux manual page[^] and having an infinite while loop in your child process. The wait() call will block the parent until the child terminates or stopps / resumes by a signal. But that never happens in your code. Note also that the unused side of a pipe...
26 Jul 2020 by Member 14686752
The client is in c# and the server is in C++. Client is as follows: client.cs namespace clinetspace { public class client { [DllImport("Server.dll")] static public extern void CallServer(IntPtr obj, int a); ...
3 Dec 2020 by Taher El Marengoze
Hi, I have an application (CustomerUI) and another (VendorUI) and a class library (DemoLib) In (VendorUI) a button that simulates adding a new product fires an event in the (DemoLib) that the (CustomerUI) is listening and should notify the...
21 Jan 2023 by Andre Oosthuizen
Richard is so right!!, you might take a project away from someone else that understands the code or have more experience than yourself, causing them harm. That been said, here is examples in C# and C++... Using C# using System; using...
13 Jun 2010 by pear76
We have a system, written by C++. When it starts running, it will start an addon program. The addon is a COM EXE (outer process server). Customers can call the addon, get the system pointer, developing new features for the system. The performance is good under windows XP, but it is slower 7~8...
13 Jun 2010 by Hristo-Bojilov
Your question is to general.You should mention the details for inter-process communication model are you using and maybe post some relevant code.Have you tried to analyse your service using a profiler like VTune or AMD code analyst?You could even debug it and find the hot spots that slow down...
27 Jun 2010 by bretthamilton
I found the solution to my problem. I found this article. .NET Remoting - Events. Events? Events![^]. I had to do things a little different.
2 Sep 2010 by markkuk
Ipchains has been obsolete since the release of Linux kernel 2.4 in 2001. Have you really installed a 10-year old Linux distro with kernel 2.2? The current firewall infrastructure in Linux is netfilter/iptables[^]. By "coding my firewall" do you mean coding a front-end for configuring and...
2 Sep 2010 by baswant
I have installed linux on my computer.I am thinking of coding my firewall on ipchains.I am getting a number of problems using it.Can anyone tell me where I will get on the net a good tutorial for the software called ipchains?
5 Oct 2010 by patilvaibhavrao
Can you give me a programatical example of the function CreateFile for PIPES.I want to give user authentication.Please help memy email id [email removed]
6 Oct 2010 by Richard MacCutchan
See here[^].
8 Oct 2010 by patilvaibhavrao
hello freinds,i m connecting to a pipe which is on the other machine (server),my machine(client) & server are connected.i m trying to use CreateFile to connect to the server.but i m getting below error:Logon failure: unknown user name or bad password.i want to pass the computer...
22 Nov 2010 by lstellyl
I am using named pipes to communicate from one process to another. All projects that I am using are running with "Target CPU -> x86"I have other libraries that i will need to use which need to be x86. When I run the projects as "Target CPU -> Any CPU" the issue seems to go away, but...
21 Jul 2011 by anunay.nayak
Hi, I need suggestion regarding interprocess communication for one of my project. Let me brief my problem first. I created a desktop application using .Net2.0 framework. The application internally uses some third party dll as well. It basically gets data feed from external server and stores...
25 Jul 2011 by Shameel
Expose your application functionality as WCF services. This[^] example might help you to get started.
27 Jul 2011 by Richard MacCutchan
If you have closed the pipe at the server end that may be the problem. Take a look at the sample code for server and client here[^] to check if you are doing it correctly.
13 Dec 2011 by renj00790
BOOL bResult = WriteFile( hPipe, // handle to pipe szBuffer, // buffer to write from strlen(szBuffer)+1, // number of bytes to write, include the NULL &cbBytes, // number of bytes written NULL); ...
2 Mar 2012 by wazuma
Howdi,here is short summary what i want to do with my programm:- i want to receive data over com1 (rs232) in a seperate thread- i dont want to use the datareceived event (from the serialport class)- a thread should read the comport and send the data to a pipeserverThread via Pipe-...
2 Mar 2012 by Sergey Alexandrovich Kryukov
This is all possible. For the port, use the class System.IO.Ports.SerialPort, see:http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.aspx[^].In your case, you should do all the port I/O operation is a separate thread and just read from it. The call is blocking: you thread...
2 Jun 2012 by Ben Baron
Java source code to demonstrate Executable Integration which is a concept of integrating several distinct executables to create a single application
5 Sep 2012 by Member 7999536
HiPHPwhen I call socket_create , it blocks and nothing happens.Here is the code .I copied it from php.netI use WebMatrix , IIS Windows. (not Apachy)error_reporting(E_ALL);set_time_limit(0);ob_implicit_flush(); $address = '192.168.0.243'; $port = 1000;echo...
11 Apr 2015 by Sergey Alexandrovich Kryukov
No. Of course, you can create some bridge/tunnel with some kind of network transport, but I'll tell you: it makes no practical sense.Here is why:Even the fact that you can exchange Windows messages across processes on the same computer, is the very weird historical artifact. The story...
22 May 2013 by YuriMaks
Hello.OS: WinXP SP3IDE: MS Visual C++ 2010 Express EditionProblem: Transmitter program can't write to mailslot. CreateFile works fine, WriteFile causes error №6 - "invalid handle". Receiver program works fine ("Process Explorer" tool shows me that mailslot exists).Receiver...
20 Aug 2013 by CPallini
Did you Google[^] for, yet?
5 Mar 2014 by SuperMiQi
Hello Everyone,I am wondering if the solution I am currently using for a project is the best approach.Here is a short description of the project:Two applications (C#) one is a server and the second a client will send and receive a queue of float array data. This data will be in real...
5 Mar 2014 by Sergey Alexandrovich Kryukov
No need to use named pipes directly if all partners are working on the CLR platform. There are channels called "IPC" in both "classical" remoting and WCF (which can be self-hosted, in a simple case). These channels are actually based on named pipes. However, there is nothing wrong with using...
18 Mar 2014 by Paul M Watt
This is an introduction to network alchemy
25 Mar 2014 by Babita22
I am implementing message queue mechanism for IPC in C linux. Below is my receiving process. It's not printing the message received. It's generating a valid msqid, and other parameters of msgrcv funtion are also correct, I think. Why so?//header files#include"msgbuf.h"int main(){ ...
26 Mar 2014 by bling
You should know this is probably 4 (or 8 on 64 bit) and not the same as sizeof (struct M1).sizeof(rbuf->m)
31 Mar 2014 by Mr.HA-AS
Hello,I have multiple writers in a form of separate processes which will get a signal at the same time to start writing on a managed shared memory segment, each writer will create its own unique managed object. On the other hand I have one reader only as a separate process. Which can access...
31 Mar 2014 by barneyman
The first item in this list[^] appears to what you're after
31 Mar 2014 by Babita22
Hi friendsI am implementing IPC using shared memory in c linux. But my client and server are generating different addresses. Why so?? or how to make them point to same memory location?I am first executing server.c and stopping after one iteration, and then client.c. And I am getting...
1 Apr 2014 by bling
This is the usual challenge in writing shared memory code. In some cases, you can force the shared memory to map to some high, unused address. In general, this may not be practical or convenient.Since the addresses are different, you can't store pointers there. Instead - you can store byte...
9 Apr 2014 by Member 9901928
im a 4th student, im making a research project about ip camera security systemim planning to make my android phone to be my ip camera and i duno how to connect it to vb.netcan anyone pls help methanks!
9 Apr 2014 by Peter Leow
Refer:1. C# \ VB.NET Camera Communication Libraries[^]2. Webcam using DirectShow.NET[^]
28 Jun 2016 by sourabhmehta
Dear All,My question is, Can we use Shared memory with IOCP ? I have seen so many examples of IOCP with sockets. What if, i want to use IOCP with shared memory? Is it possible?/Thanks in advance.What I have tried:I have tried implementing IOCP with sockets and it works fine. can...
29 Mar 2017 by Shofiqul Alam
I'm trying to communicate between two application,one is MFc another is WPF.So far i have taken help from the following two links :[^] Interprocess Communication Between .NET and MFC Using WM_COPYDATA[^]What I have tried:So far i have managed to send message from wpf to mfc...
18 Jan 2017 by Jagssnaik
I am working on a project where I am interacting between the components of VC++ (Server) and C# Client.The C# component is been triggered by VC++ and further interactions happens between these components over Control Pipes.The Control pipe is created at the VC++ as...
29 Mar 2017 by avisal
Once I used interprocess communications between MFC and WPF using memory mapped filesWorked great with a big amount of data back and force.Try that.There is a bunch of APIs for that
27 Jul 2017 by ilostmyid2
In the following code namespace ns { public partial class Form1 : Form { public Form1() { InitializeComponent(); } string ProcessCommand(string cmd) { return "i got " + cmd; } StreamReader d_sr; ...
12 Sep 2017 by forest-321
Hi, all! There are 2 applications on windows: a application compiled with cygwin, a MFC application. How to communicate between two processes? Here, main process is MFC application, sub process is the application compiled with cygwin. Thanks. What I have tried: I can't use PostMessage, pipe,...
26 Jun 2018 by keshav desai
I want to communicate between child process and parent process but it is not working . The child function only executing and not going into the parent function What I have tried: #include #include #include #include int main(int argc, char const...
26 Jun 2018 by Richard MacCutchan
See write on pipe in C - Stack Overflow[^].
26 Aug 2020 by chrispdraycott
I am looking at IPC between .NET and C on Linux. I have managed to get some shared memory working using: C shm_open and mmap C# MemoryMappedFile I need a mechanism though to be able to synchronize the changes between my .NET application and...
20 Jul 2020 by OriginalGriff
We are more than willing to help those that are stuck: but that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us...
28 Jul 2020 by Member 14686752
I have an application whose UI is in C#, WPF and this UI is using c++ DLL for performing operations. I am calling the c++ DLL methods from my UI in this way and it is working fine. If C++ DLL will get some exception or error during execution then...
26 Jul 2020 by KarstenK
Running an infinite loop is bad style. You should handle the error and than move by finding a way out. Ensure that the C++ error are handled in C++ completly and you only inform C# about the occured issue. Read my article about Callbacks...
28 Jul 2020 by steveb
Generally any error code generated by an API call can be queried with GetLastError() function and FormatMessage() can give textual representation of that error using FORMAT_MESSAGE_FROM_SYSTEM flag. Both of which you can call from the C# app
26 Aug 2020 by Jeltz1
Using a byte or two in shared memory as a variable for a state machine defining which part C / .Net gets access at what times is most likely your best option. Assuming you have a multi-thread CPU at your disposal, there is no great difficulty...
3 Dec 2020 by CHill60
There are several articles here on CodeProject on the topic of IPC / Inter-process Communication. Start here ..Search[^]
2 Dec 2021 by Avtem
I wrote a DLL with hook of type WH_GETMESSAGE. What I want to do is store an std::vector inside that DLL and being able to manipulate it from my app. But the problem is that when my app calls DLL function createMyObjects() vector's size...
2 Dec 2021 by Rick York
Hook procedures are called in the context of the process that generates the message. Here is what the docs (Hooks Overview - Win32 apps | Microsoft Docs[^]) say on the topic : Quote: A global hook monitors messages for all threads in the same...
10 Aug 2023 by pavan idirect
I am trying to come up with a design to efficiently send a tree data structure (each node can have more than 2 branches) to a socket/different process etc. There seems to be a cap on how much data can be sent in one message (1500 Bytes). The tree...
28 Feb 2022 by pdoxtader
A simple and convenient wrapper class for Anonymous Pipes in C# using serialization.
17 Mar 2014 by Ondrej_Uzovic
Improve the performance of interprocess communication between Android and .NET using fast binary serialization (Protocol Buffers) instead of XML or JSON.
27 Sep 2017 by ChRi$m0rG@N
This article documents a simple messaging layer implemented with named pipes.
12 Mar 2014 by Ivan Perevernykhata
This article introduces tiny library, that allows easily use IPC with C# (share objects, send messages and exchange data in few lines of code).
22 Jul 2020 by honey the codewitch
Diving into some of the core plumbing behind the Windows operating system
2 Sep 2011 by Alexander Bessonov
A simple high-level IPC library with ability to use native C++ interfaces.
26 Sep 2010 by TheUberOverLord
Monitors All Skype4COM and API Messages for Skype Includes Command Input. Shows What Goes On Behind The Scenes with Skype Message Processing using the API and Skype4COM Library. Includes Microsoft ClickOnce Deployment Technology As Well As ClickOnce Automatic Updates Examples. A Must Have Tool!
27 Dec 2010 by Mr Nukealizer
Ideal for finding LoadLibrary() in 32 bit programs from a 64 bit program but it works for any function in any DLL and supports forwarded functions and ordinals.
14 Apr 2018 by Andy Galluzzi
Join me to create the most advanced yet most simple to use full duplex MMF based IPC for Windows
5 Mar 2014 by dan!sh
Since you are doing real time like processes, make use of pipes. This[^] MSDN page provides decent information to start off.
14 Apr 2018 by Andy Galluzzi
This is yet another MMF IPC data transfer class, but with the particularities of a logging tool: it has one operative process that simply collects all the logged data and one or more passive process that generates and writes the log information.
28 Oct 2014 by bvinothraj
C++ Wrapper for Pipe-based IPC in Windows
13 Apr 2013 by johnbMA
Hi:I am trying to use WCF to setup IPC between 2 running windows applications.I want to start out by saying that I know there are other (better?) ways to implementthis solution. But, due to some pre-existing design considerations/constraints, I'm bound to using: - netTcpBinding -...
20 Apr 2020 by Member 14807614
I am pretty new to the concepts of inter-process communication, therefore, need some help, I need to implement a multiple producer-consumer problem using message queues in which there is a manager process that calls 5 producers and 5 consumers...
20 Apr 2020 by k5054
You will need to call fork() for each producer and consumer you wish to create, so more like pid_t producers[NUM_PRODUCERS]; pid_t consumers[NUM_CONSUMERS]; for(size_t i = 0; i
25 Jul 2020 by Shao Voon Wong
The C# client can do polling. While polling is easy to do, it is inefficient and a waste of CPU cycles. C++ server can create event(CreateEvent[^]) and signal the event handle whatever there is data to be received. C# client will create object...
22 Jan 2023 by merano99
A C++ std::mutex instance is limited to a single process; if you need cross-process mutexes, as here, you could use operating system semaphores or, under Linux, Posix mutexes in shared memory. If the first process sets a system-wide mutex...
1 May 2020 by honey the codewitch
Creating an application that can run once, but then accept command line args from subsequent runs
17 Nov 2012 by Joezer BH
In Windows, what's the best practice to perform IPC between a main process and many sub processes it handles?The question regards a situation which requires high frequency calls, and the server is operating in full usage of it's CPU for the length of the loooong calculation in each...
8 Sep 2019 by Code Artist
TCP Application Protocol is an IPC (Inter-process Communication) created to provide common remote interface for between applications.
13 Jun 2010 by rodcarlocastillo
Is there a way for me to call a function from an external application? For example I have a POS application and its functions are exported in DLL and one of the functions is addItem(param1...,param2...) which adds an item to list in the POS. Would it be possible to call that function from my...
19 Feb 2013 by hans.sch
I wonder whether it is possible to send or post a Window message, such as WM_COPYDATA, to an application that is running on a different computer on the same network. I guess the answer is "no" but if someone has different experience, please tell - and say how I can get a window handle for that...
25 Dec 2019 by Rahul saraswat
Hi, Can anyone tell me that ....Can IPC remoting work on two network systems. If yes,the How ? Please help me.I know about TCP.. it works fine. I want to know about IPC only.C i am using IPCChannel for remoting under the namespace of System.Runtime.Remoting.Channels.Ipc. and i have...
2 Oct 2015 by Patrice T
Quote:The question I have is that what happens to the memory when the creator crashes abnormally.Whatever the reason, consequences can't be good.The best is to not crash at all.Use technic like try/catch to guard risky parts of your code.Remove as much bugs as possible, the debugger will...
21 Jan 2023 by CoadyCoder
Create a global mutex, this will help us to identify if another instance of the same application is running, this is needed as its inter process communication. 3. Start a thread which runs continuously with a sleep of 1 sec and write "Worker...
25 Dec 2019 by Илья Агачкин
NO! IPC it's named pipe. Can be provided only inside a machine