473,383 Members | 1,984 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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
Jun 27 '08 #1
6 6570
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 (jm******@mail-on.us)
Jun 27 '08 #2
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
Jun 27 '08 #3
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.
http://www.velocityreviews.com/forum...c-in-java.html

In the discussion I found this nugget:
http://www.bmsi.com/java/posix/package.html

--

Jerry McBride (jm******@mail-on.us)
Jun 27 '08 #4

"Jerry McBride" <jm******@mail-on.uswrote in message
news:f5************@supertux.my.domain...
>
No sockets... How about named pipes via the Files class?
I'll give it a try.
Here's a discussion I found useful.
http://www.velocityreviews.com/forum...c-in-java.html

In the discussion I found this nugget:
http://www.bmsi.com/java/posix/package.html
Thanks

/Kasper
Jun 27 '08 #5


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.
Jul 18 '08 #6
Ian Semmel <is***********@NOJUNKrocketcomp.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!
Aug 20 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: ChrisWinterscheid | last post by:
We are running DB2 8.1 on AIX 5.2. DB2level shows: DB21085I Instance "db2inst1" uses "32" bits and DB2 code release "SQL08016" with level identifier "02070106". Informational tokens are "DB2...
4
by: Frank Meng | last post by:
Hi. I am trying a csharp sample from http://www.codeproject.com/csharp/socketsincs.asp . (Sorry I didn't post all the source codes here, please get the codes from above link if you want to try)....
4
by: Viper Venom | last post by:
Dear All: I am trying to write an application that consist 2 executables 1) Server.exe 2) Client.exe I start the server.exe first and then start the two client exe by code and kill both of...
7
by: A.M | last post by:
Hi, What is the best way to implemet Inter Process Communication in .NET ? I developed two programs and I want to have them talk to each other. Thanks, Alan
0
by: Hugo Ferreira | last post by:
Hi everyone! Here's the current scenario: I have a program in Python that computes something very fast (<1s), but it takes a considerable amount of time to read the startup data (>90s). Since...
2
by: hiharsh | last post by:
Hi Friends, I am trying to implement C programs say Transmit.c and Receive.c Transmit Program would periodicall send message while Receive program will listen to those messge. I will add...
8
by: JamesHoward | last post by:
I am looking for a way of performing inter process communication over XML between a python program and something else creating XML data. What is the best way of performing this communication? I...
6
by: ecir.hana | last post by:
Hi, let's say I have two scripts: one does some computations and the other one is a graphical front end for launching the first one. And both run in separate processes (front end runs and that it...
7
by: ecir.hana | last post by:
Hello, just to recap: last time I asked how to do an interprocess communitation, between one Manager process (graphical beckend) and some Worker processes. I decided to go with sockets,...
0
by: dantz | last post by:
After reading all of the materials in msdn about interprocess communication now I am confused. I hope someone can give me some enlightment. I am developing a multithreaded client-server...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.