• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Inter-Process communication in Java

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I want to make two Java processes communicate with each other.I want to know which one will be the easiest one(Pipes,Named Pipes,Mailslots,shared memory etc). I can use all these methods in C++, but how to do them in Java.Is there any good tutorial available?All the ones I have seen so far are kind of advanced and I cannot follow them.The Process A and B has to communicate with very simple messages(To be precise, Process A will tell it is out there running and process B will query using IPC mechanism to see A is there running and if so,it does it own course of action). I dont want to use File based or Socket based communication.

Thanks in Advance.
Arun.
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sockets, RMI, SOAP, just to name a few.
 
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if you don't mind me asking, why don't you want to use sockets in this application? they sound like the perfect match to your requirements, to me.

anyway, failing sockets, i'd go for named pipes to do this. but that's because i have a Unix mindset; i don't know how well named pipes would do on a non-Unix platform (are they even available in Java?). the most general method is likely RMI, but that is also likely to have the highest overhead and might be severe overkill for your application.

sockets are fairly lightweight, easy to use - not much more trouble than pipes or named pipes - and can be easily scaled from two processes on the same machine to having the processes communicate across machines. (on Unix, sockets can even live in the filesystem like named pipes for localhost-only IPC - but again, i'm not sure how cross-platform compatible that would be.) why would you prefer to avoid them?
 
It's a tiny ad. At least, that's what she said.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic