
June 27th, 2008, 09:25 PM
| | | 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 |

June 27th, 2008, 09:25 PM
| | | Re: Inter Process Communication, full-duplex
Kasper Lindberg wrote: Quote:
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) | 
June 27th, 2008, 09:25 PM
| | | Re: Inter Process Communication, full-duplex
Jerry McBride skrev: Quote:
>
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 | 
June 27th, 2008, 09:25 PM
| | | Re: Inter Process Communication, full-duplex
Kasper Lindberg wrote: Quote:
Jerry McBride skrev: Quote:
>>
>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 (jmcbride@mail-on.us) | 
June 27th, 2008, 09:25 PM
| | | Re: Inter Process Communication, full-duplex
"Jerry McBride" <jmcbride@mail-on.uswrote in message
news:f5qnh5xp2b.ln2@supertux.my.domain... Quote:
>
No sockets... How about named pipes via the Files class?
>
| I'll give it a try. Thanks
/Kasper | 
July 18th, 2008, 08:25 PM
| | | Re: Inter Process Communication, full-duplex
Kasper Lindberg wrote: Quote:
Jerry McBride skrev: Quote:
>>
>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. | 
August 20th, 2008, 02:05 AM
| | | Re: Inter Process Communication, full-duplex
Ian Semmel <isemmelNOJUNK@NOJUNKrocketcomp.com.au>
on Friday 18 July 2008 15:19
wrote in comp.lang.java: Quote:
>
>
Kasper Lindberg wrote: Quote:
>Jerry McBride skrev: Quote:
>>>
>>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 [...] Quote:
>
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! | | Thread Tools | Search this Thread | | | |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | | | | What is Bytes?
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 205,414 network members.
|