Java IPC Query

Discussion in 'Java' started by Gordon Beaton, Nov 30, 2005.

  1. On 30 Nov 2005 08:14:51 -0800, wrote:
    > In c++ we had named pipes which could be refered from other
    > application but I am unable to find such a mechanism in standard
    > java library. Does this feature exists or I will have to resort to
    > loop back Socket programming to achive this.


    Named pipes can be treated as ordinary files - you can read from them
    and write to them using FileInputStreams and FileOutputStreams.
    However Java doesn't provide any mechanism for creating them, for that
    you need to call mknod() from a native method, or use an external
    helper (like mknod -p).

    However if you use Sockets your application will be more portable, and
    has the advantage that your communicating processes don't need to run
    on the same machine. (Your application does not need to handle the
    "loop back" case specially as you seem to imply).

    /gordon

    --
    [ do not email me copies of your followups ]
    g o r d o n + n e w s @ b a l d e r 1 3 . s e
     
    Gordon Beaton, Nov 30, 2005
    #1
    1. Advertising

  2. Gordon Beaton

    Guest

    Hello Group,


    I have just began programming in java language from a backgroud of
    programming in C++. I wanted to know that does java supports IPC
    mechanism such as named pipes so as to enable communication betweem two
    separate application instances running on diffrent instances of virtual
    machines. In c++ we had named pipes which could be refered from other
    application but I am unable to find such a mechanism in standard java
    library. Does this feature exists or I will have to resort to loop back
    Socket programming to achive this.


    Thanks in Advance,

    VJ
     
    , Nov 30, 2005
    #2
    1. Advertising

  3. Gordon Beaton

    Roedy Green Guest

    On 30 Nov 2005 08:14:51 -0800, ""
    <> wrote, quoted or indirectly quoted someone
    who said :

    >In c++ we had named pipes which could be refered from other
    >application but I am unable to find such a mechanism in standard java
    >library.


    you have sockets, and RMI for that function. Pipes only work with in
    the same JMM.
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
     
    Roedy Green, Nov 30, 2005
    #3
  4. On Wed, 30 Nov 2005 22:10:32 GMT, Roedy Green wrote:
    > you have sockets, and RMI for that function. Pipes only work with in
    > the same JMM.


    Pipes are not exclusive to Java, and yes they work between processes.
    The OP specifically mentioned "named pipes". He was not asking about
    PipedInputStream and PipedOutputStream, which have the limitation you
    mention.

    /gordon

    --
    [ do not email me copies of your followups ]
    g o r d o n + n e w s @ b a l d e r 1 3 . s e
     
    Gordon Beaton, Dec 1, 2005
    #4
  5. Gordon Beaton

    Roedy Green Guest

    On 1 Dec 2005 08:41:34 +0200, Gordon Beaton <> wrote,
    quoted or indirectly quoted someone who said :

    >Pipes are not exclusive to Java, and yes they work between processes.


    Pipes in Java refer to PipedInputStream and PipedOutputStream. These
    are for intra-JVM communication only.

    Pipes outside Java refer to all manner of things from output
    redirection of the console in DOS to socket-like things in Unix to
    complex plumbing in Burroughs.
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
     
    Roedy Green, Dec 1, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. piyush
    Replies:
    0
    Views:
    1,848
    piyush
    Jul 14, 2004
  2. Day9901

    Java IPC

    Day9901, Feb 7, 2004, in forum: Java
    Replies:
    1
    Views:
    670
    Andrew Thompson
    Feb 7, 2004
  3. tom fredriksen

    ipc in java

    tom fredriksen, Mar 21, 2006, in forum: Java
    Replies:
    11
    Views:
    28,938
    Nigel Wade
    Mar 24, 2006
  4. Replies:
    1
    Views:
    665
    Paul Boddie
    Dec 1, 2005
  5. Replies:
    3
    Views:
    1,718
    Michael Rauscher
    Aug 20, 2006
Loading...

Share This Page