Connecting Tech Pros Worldwide Help | Site Map

Inter Process Communication, full-duplex

  #1  
Old June 27th, 2008, 09:25 PM
Kasper Lindberg
Guest
 
Posts: n/a
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


  #2  
Old June 27th, 2008, 09:25 PM
Jerry McBride
Guest
 
Posts: n/a

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)
  #3  
Old June 27th, 2008, 09:25 PM
Kasper Lindberg
Guest
 
Posts: n/a

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
  #4  
Old June 27th, 2008, 09:25 PM
Jerry McBride
Guest
 
Posts: n/a

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)
  #5  
Old June 27th, 2008, 09:25 PM
Kasper Lindberg
Guest
 
Posts: n/a

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.
Quote:
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


  #6  
Old July 18th, 2008, 08:25 PM
Ian Semmel
Guest
 
Posts: n/a

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.
  #7  
Old August 20th, 2008, 02:05 AM
Daniel Molina Wegener
Guest
 
Posts: n/a

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!
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
PDF preview in a c++ application Hans Stoessel answers 4 May 15th, 2006 06:35 PM
SOAP Performance - Really so slow ? frankgerlach@gmail.com answers 52 December 5th, 2005 10:35 PM
c++ and databases cppaddict answers 4 July 19th, 2005 08:50 PM
One Small step one infinite leap zetasum answers 0 July 18th, 2005 10:13 PM
One Small step one infinite leap zetasum answers 4 July 17th, 2005 12:21 PM