Inter Process Communication, full-duplex

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kasper Lindberg

    Inter Process Communication, full-duplex

    Hi NG,

    How to do two-way-interprocess communication using java?

    Imagine a client/server setup where the client can request a number of
    functions to be performed by the server.

    Since the server sometimes pushes messages to the client(s), and no
    assumption can be made regarding the client and when/how often it is
    running, a second program (call it CPM) is running on the client machine.
    This program receives the messages, processes them and stores the result of
    this processing.

    When the client tries to execute a call to the server, it should contact the
    CPM-program using inter-process-communication.
    The client will send a description to the CPM, indicating the intended
    action. The CPM then processes this request, compares with the stored result
    of received/processed messages and replies to the client.

    If both programs where written in java, what would you suggest?

    If the CPM-program was written in C++ and used a named pipe called
    \\.\pipe\MyPipe , What would you suggest?

    --
    Kind Regards
    /Kasper


  • Jerry McBride

    #2
    Re: Inter Process Communication, full-duplex

    Kasper Lindberg wrote:
    Hi NG,
    >
    How to do two-way-interprocess communication using java?
    >
    Imagine a client/server setup where the client can request a number of
    functions to be performed by the server.
    >
    Since the server sometimes pushes messages to the client(s), and no
    assumption can be made regarding the client and when/how often it is
    running, a second program (call it CPM) is running on the client machine.
    This program receives the messages, processes them and stores the result
    of this processing.
    >
    When the client tries to execute a call to the server, it should contact
    the CPM-program using inter-process-communication.
    The client will send a description to the CPM, indicating the intended
    action. The CPM then processes this request, compares with the stored
    result of received/processed messages and replies to the client.
    >
    If both programs where written in java, what would you suggest?
    >
    If the CPM-program was written in C++ and used a named pipe called
    \\.\pipe\MyPipe , What would you suggest?
    >
    How about sockets? Works locally, on the lan or across the Inet...


    --

    Jerry McBride (jmcbride@mail-on.us)

    Comment

    • Kasper Lindberg

      #3
      Re: Inter Process Communication, full-duplex

      Jerry McBride skrev:
      >
      How about sockets? Works locally, on the lan or across the Inet...
      >
      Sockets are fine, if you are trying to communicate between 2 (or more)
      machines, but I do not have that problem. My processes are running on
      the same machine and therefore should not use sockets.

      Additionally, the machines that these programs will be running on have a
      very strict firewall policy. Depending on the firewall, it may or may
      not block connections to my CPM-program. I don't see a reason to
      introduce this potential problem if I can help it. (I will not be the
      one to setup/install the system in question)

      So, if I ignore the use of sockets, for a moment, what are my options
      for performing inter-process-communication using java?


      --
      Kind Regards
      /Kasper

      Comment

      • Jerry McBride

        #4
        Re: Inter Process Communication, full-duplex

        Kasper Lindberg wrote:
        Jerry McBride skrev:
        >>
        >How about sockets? Works locally, on the lan or across the Inet...
        >>
        >
        Sockets are fine, if you are trying to communicate between 2 (or more)
        machines, but I do not have that problem. My processes are running on
        the same machine and therefore should not use sockets.
        >
        Additionally, the machines that these programs will be running on have a
        very strict firewall policy. Depending on the firewall, it may or may
        not block connections to my CPM-program. I don't see a reason to
        introduce this potential problem if I can help it. (I will not be the
        one to setup/install the system in question)
        >
        So, if I ignore the use of sockets, for a moment, what are my options
        for performing inter-process-communication using java?
        >
        >
        No sockets... How about named pipes via the Files class?

        Here's a discussion I found useful.
        สล็อตเว็บตรง API แท้ ไม่ผ่านเอเย่นต์ เว็บสล็อตใหม่ล่าสุด ฝากถอนง่าย ผ่านทุกธนาคารในไทย เว็บตรง 100% เบทน้อยเล่นได้ ทุกที่ทุกเวลา


        In the discussion I found this nugget:




        --

        Jerry McBride (jmcbride@mail-on.us)

        Comment

        • Kasper Lindberg

          #5
          Re: Inter Process Communication, full-duplex


          "Jerry McBride" <jmcbride@mai l-on.uswrote in message
          news:f5qnh5xp2b .ln2@supertux.m y.domain...
          >
          No sockets... How about named pipes via the Files class?
          >
          I'll give it a try.
          Here's a discussion I found useful.
          สล็อตเว็บตรง API แท้ ไม่ผ่านเอเย่นต์ เว็บสล็อตใหม่ล่าสุด ฝากถอนง่าย ผ่านทุกธนาคารในไทย เว็บตรง 100% เบทน้อยเล่นได้ ทุกที่ทุกเวลา

          >
          In the discussion I found this nugget:

          >
          Thanks

          /Kasper


          Comment

          • Ian Semmel

            #6
            Re: Inter Process Communication, full-duplex



            Kasper Lindberg wrote:
            Jerry McBride skrev:
            >>
            >How about sockets? Works locally, on the lan or across the Inet...
            >>
            >
            Sockets are fine, if you are trying to communicate between 2 (or more)
            machines, but I do not have that problem. My processes are running on
            the same machine and therefore should not use sockets.
            >
            Additionally, the machines that these programs will be running on have a
            very strict firewall policy. Depending on the firewall, it may or may
            not block connections to my CPM-program. I don't see a reason to
            introduce this potential problem if I can help it. (I will not be the
            one to setup/install the system in question)
            >
            So, if I ignore the use of sockets, for a moment, what are my options
            for performing inter-process-communication using java?
            >
            >
            There is no reason why you can't open a socket connection to your local host.

            It also has the advantage that if you ever want to move your server to another machine your almost there.

            Comment

            • Daniel Molina Wegener

              #7
              Re: Inter Process Communication, full-duplex

              Ian Semmel <isemmelNOJUNK@ NOJUNKrocketcom p.com.au>
              on Friday 18 July 2008 15:19
              wrote in comp.lang.java:

              >
              >
              Kasper Lindberg wrote:
              >Jerry McBride skrev:
              >>>
              >>How about sockets? Works locally, on the lan or across the Inet...
              >>>
              >>
              >Sockets are fine, if you are trying to communicate between 2 (or more)
              >machines, but I do not have that problem. My processes are running on
              >the same machine and therefore should not use sockets.
              >>
              >Additionally , the machines that these programs will be running on have a
              >very strict firewall policy. Depending on the firewall, it may or may
              >not block connections to my CPM-program. I don't see a reason to
              >introduce this potential problem if I can help it. (I will not be the
              >one to setup/install the system in question)
              >>
              >So, if I ignore the use of sockets, for a moment, what are my options
              >for performing inter-process-communication using java?
              >>
              >>
              >
              There is no reason why you can't open a socket connection to your local
              host.
              Really, comunications from localhost to localhost -- aka 127.0.0.1
              or ::1 -- usually isn't blocked by firewalls, also it's true that the
              localhost is used by many programs to ensure IPC tasks. Also you can
              try something more friendly, such as CORBA or RMI under localhost [...]
              >
              It also has the advantage that if you ever want to move your server to
              another machine your almost there.
              Easy to port to distributed computing...

              Regards,
              --
              .O. | Daniel Molina Wegener | C/C++ Developer
              ..O | dmw [at] coder [dot] cl | FOSS Coding Adict
              OOO | http://coder.cl/ | Standards Rocks!

              Comment

              Working...