Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2005

Tip: Looking for answers? Try searching our database.

Java IPC Query

Thread view: 
mr.vaibhavjain@gmail.com - 30 Nov 2005 16:14 GMT
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
Gordon Beaton - 30 Nov 2005 15:24 GMT
> 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

Signature

[  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

Roedy Green - 30 Nov 2005 22:10 GMT
On 30 Nov 2005 08:14:51 -0800, "mr.vaibhavjain@gmail.com"
<mr.vaibhavjain@gmail.com> 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.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Gordon Beaton - 01 Dec 2005 06:41 GMT
> 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

Signature

[  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

Roedy Green - 01 Dec 2005 08:23 GMT
>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.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.