-
August 22nd, 2010, 07:58 AM
#1
Interprocess communication
I wanted to implement interprocess communication without using named pipes, without using memory mapped files, without using sockets. I wanted to implement my own method of communication between processes, and here is my result: http://gist.github.com/543717
I was hoping someone could look over my code and give me some constructive feedback about how to improve it, and possibly how better to design it. It is also a bit buggy, meaning that the wrong input could cause errors. If someone could please just take a look I would really appreciate it.
-
August 22nd, 2010, 02:10 PM
#2
Re: Interprocess communication
It looks like a clean implementation.
I don't like to rely on the windows messaging system to perform interprocess communication.
I say this because the processing of windows messages can be stalled for a variety of reasons and interrupt the passing of IP data. I guess you can mitigate this somewhat by putting your code into message handling worker threads.
-
August 22nd, 2010, 03:05 PM
#3
Re: Interprocess communication
Besides, this would require to have a message queue always, disregarding of the type of the app, otherwise it should be stated "for windowed apps only". Sounds like not a general solution, unlike pipes, MMFs and sockets.
Best regards,
Igor
-
August 28th, 2010, 07:48 PM
#4
Re: Interprocess communication
Thanks for your comments.
My code actually does handle all the windows messages in a separate thread so you don't have to. All you have to do is read and write to connection objects.
Also, I've rewritten a great portion of the code now, so I don't think it is as buggy anymore. I had to remove the stuff with the ports; that wasn't working out. But now you just connect to an application and an end point called an AppPhone is created. You just read and write to this object, and you can communicate between processes.
Take a look: http://gist.github.com/555774
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|