Click here to Skip to main content
Licence 
First Posted 8 Apr 2000
Views 267,634
Bookmarked 45 times

Communicating with Remote Processes without DCOM or CORBA

By | 30 Apr 2001 | Article
Introduce a new interprocess communication tool
  • Download XYMessenger, its documentation, related tools, and sample code - 1.11 Mb
  • Introduction

    Sure, there may be a thousand different ways to do interprocess communication without using DCOM or CORBA. But my knowledge in this area is very limited. As a matter of fact, I don't know that much about DCOM and CORBA, either. I use ActiveX/COM daily in my work, but never DCOM. I understand that DCOM and CORBA are general communication protocols that can be used to build wonderful client-server systems. After some reading, I found out that programming with CORBA is not easy and I also found out that some other people agree with me. DCOM is not that hard to me since I already know how to use COM, but can I use it in platforms other than Win32, say AIX, without writing tons of low level code to support it?

    Here is what I need most: a simple way to send a block of bytes of any size (a message) from one process to another. The process receiving it should be able to send a reply message back to the original sender. How the blocks of bytes (the message and the reply) are interpreted are strictly the business of the sender and the receiver. That is, the message could be the contents of a file, or a record in an Oracle table, or any other data.

    That is easy, you may say. Just open a socket connection between the two processes and send the message (the block of bytes). But I want more. I want to be able to connect more processes (may be 100 or may be 1000) together in a way that any connected process can send a message to any other connected process. I want messages to be sent in two ways, synchronous and asynchronous. By synchronous I mean the "send" function will not return until the receiver "reply" to the message or time-out occurs.

    Here is my solution. I will start one process as the root server. Then one or more processes can be connected to the root server. Each of these processes can have one or more processes connected to it. All the connected processes form a tree structure. I call it the Communication Tree. Any two processes within the same tree will be able to to communicate with each other by sending and receiving messages. Of course, if the two processes are not directly connected, then the messages between them have to be routed by one or more intermediate processes. Note that each process needs only to "connect" once to join the Communication Tree.

    This must be more complicated than learning DCOM or CORBA (assuming you can use DCOM or CORBA to implement the above features), right? Wrong! Because all the code implementing the above features can be wrapped in a single component (a black box). This component is an ActiveX control I wrote. It is a very small control considering what it can do. Of course, I spent a lot of weekend and vacation time to write it. The good news is, it is a general control that can be reused in all VB and VC++ (MFC) programs. All you need to do is inserting it into your programs and your programs will be able to talk to each other by calling methods of this control. By the way, the control is named XYMessenger.

    What about other platforms? The answer is, I have ported XYMessenger to Java. XYMessenger is also the name of a Java class. This class has almost identical methods as the ActiveX control with the same name. And they are compatible. That is, Java programs using the XYMessenger class can communicate with Win32 programs using the XYMessenger control.

    What is the use of XYMessenger, if the only kind of message it can send or receive is a block of bytes? I wrote other useful tools that can turn a complicated data object into a block of bytes so that it can be send via a message and restore the object from the block of bytes once the message is received.

    For the latest version of XYMessenger, its documentation, other related tools, as well as sample code, check my website. The package actually contains some other cool stuff, which I will probably introduce in another article.

    I understand that my solution has its limitations, too. And it cannot replace any general protocol. Please e-mail me your comments (I may not be able to answer all mails, however).

    History

    1 May 2001 - updated source files

    License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here

    About the Author

    Xiangyang Liu 刘向阳



    United States United States

    Member



    Sign Up to vote   Poor Excellent
    Add a reason or comment to your vote: x
    Votes of 3 or less require a comment

    Comments and Discussions

     
    You must Sign In to use this message board. (secure sign-in)
     
    Search this forum  
     FAQ
        Noise  Layout  Per page   
      Refresh
    GeneralXYMessenger in Vista Pinmemberspunglord3:01 24 Oct '08  
    Generalquestion Pinmemberraphael1680:20 26 May '06  
    GeneralRe: question PinmemberXiangyang Liu1:38 26 May '06  
    QuestionWeb site? PinmemberWes Aday16:27 14 Mar '06  
    AnswerRe: Web site? PinmemberXiangyang Liu16:33 14 Mar '06  
    GeneralRe: Web site? PinmemberWes Aday16:39 14 Mar '06  
    GeneralI want source code for sample programs with XYMessenger Pinmemberg_thiru0:44 2 Jun '04  
    GeneralRe: I want source code for sample programs with XYMessenger PinmemberXiangyang Liu2:34 2 Jun '04  
    GeneralI want source code for sample programs with XYMessenger Pinmemberg_thiru23:31 15 May '04  
    GeneralRe: I want source code for sample programs with XYMessenger PinmemberXiangyang Liu1:41 16 May '04  
    GeneralRe: I want source code for sample programs with XYMessenger Pinmemberg_thiru2:26 30 May '04  
    GeneralProblems PinsussAndrej Fraissl23:43 17 Sep '03  
    GeneralRe: Problems PinmemberXiangyang Liu2:21 18 Sep '03  
    GeneralProblems... PinmemberTruongNX1:01 5 Sep '03  
    GeneralRe: Problems... PinmemberXiangyang Liu5:42 5 Sep '03  
    GeneralRe: Problems... PinmemberTruongNX18:11 5 Sep '03  
    GeneralRe: Problems... PinmemberXiangyang Liu4:13 6 Sep '03  
    Question你是那里人? Pinmemberttzzgg_807139:13 29 Nov '02  
    AnswerRe: 你是那里人? PinsussXiangYangLiu9:21 29 Nov '02  
    AnswerRe: 你是那里人? PinmemberShaun Wilde9:37 29 Nov '02  
    GeneralRe: 你是那里人? PinmemberJeff Patterson15:41 29 Nov '02  
    Generalsincere thanks to codeprojects.com Pinsussm. rama kkrishna1:13 30 Sep '02  
    GeneralRe: sincere thanks to codeprojects.com PinsussXiangYangLiu4:04 30 Sep '02  
    QuestionXYSystem -or- DCOM -or- CORBA ??? PinmemberChristopher Bahns14:32 7 Jul '01  
    AnswerRe: XYSystem -or- DCOM -or- CORBA ??? PinmemberDougie4:23 26 Mar '02  

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

    Permalink | Advertise | Privacy | Mobile
    Web01 | 2.5.120528.1 | Last Updated 1 May 2001
    Article Copyright 2000 by Xiangyang Liu 刘向阳
    Everything else Copyright © CodeProject, 1999-2012
    Terms of Use
    Layout: fixed | fluid