Interprocess communication
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Interprocess communication

  1. #1
    Join Date
    Dec 2005
    Posts
    114

    Red face 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.

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,295

    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.

  3. #3
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    5,976

    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

  4. #4
    Join Date
    Dec 2005
    Posts
    114

    Wink 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
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center