Results 1 to 8 of 8
- 11-06-2010, 08:35 AM #1
Member
- Join Date
- May 2010
- Location
- Poland-Silesia
- Posts
- 15
- Rep Power
- 0
Named pipes between Java and C/C++ programs
Hi All.
I think of using in windows a named pipe to communicate between two apps written in Java and C. Normally i use socket connection to do this, but now i have to cancel this idea and find a new solution.
I read that named pipe in java can be visible only inside JVM-is this true?
Is there a way to establish named pipe between two apps wriiten in different language?
If not, what kind of technology do You advice?
regards
Lucjan
-
I don't know the solution, but I'm curious why a socket won't work for you?
Luck!
- 11-06-2010, 12:38 PM #3
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Let see others comments on this, however as far as I know there is no specific API for name pipes. Did you find a one.
- 11-06-2010, 04:43 PM #4
Senior Member
- Join Date
- Mar 2009
- Posts
- 552
- Rep Power
- 5
I'd guess that there is no way of using named pipes directly from Java, as they're very platform-dependant. If sockets won't work for you, you'll probably have to go through the JNI (Java Native Interface) to create, and possibly to write/read named pipes.
If the above doesn't make sense to you, ignore it, but remember it - might be useful!
And if you just randomly taught yourself to program, well... you're just like me!
- 11-06-2010, 04:51 PM #5
Senior Member
- Join Date
- Mar 2010
- Location
- Manila, Philippines
- Posts
- 257
- Rep Power
- 4
I don't know about the Pipe classes.
But I'm also curious to these, why use Socket method?
Also what I have read, Pipe classes are best used within the OS not in the JVM.
(I just researched it, but never tried it so far)
Better read further about Pipe classes.
And understand some Pipe implemented sample programs
It might work for you.
Regards,
Cyril H.Every project, package, class, method, variable, syntax, algorithm, etc.
are registered in my memory bank. Thanks to this thread.
-
Some useful links I've found through Google:
tutorials.jenkov.com/java-io/pipes.html
how-to-open-a-windows-named-pipe-from-java
Most I've seen recommend sockets or if one needs pipes, then JNI (I suppose JNA would work as well then).
[caveat: I'm no expert in this but am just passing on my interpretations of what I've read]Last edited by Fubarable; 11-06-2010 at 05:01 PM.
- 11-07-2010, 12:46 AM #7
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Sounds the first link has a nice explanation Fubarable. Thanks for sharing with us.
- 11-07-2010, 11:28 AM #8
Member
- Join Date
- May 2010
- Location
- Poland-Silesia
- Posts
- 15
- Rep Power
- 0
Hi all:) Thanks for feedback.
In the first link -PipedInputStream and PipedOutputStream classes are useless:/ This is a way to communicate only between threads etc in one JVM.
I read a lot and the conclusion is that there is no way to create NamedPipe in windows(or other OS) directly. The onsly way to create it, is to use JNI/JNA to invoke a CreateNamedPipe native function in one of windows dll's. But then.....
I found this:
V01ver-HowTo Collection: HowTo: Use Named Pipes to Communicate Between Java and .Net Processes
So in java probably no matter the OS, I can connect to an existing pipe:) I didn't test It yet but soon I will wrote few sentences about the result.
In my situation-I'am not forced to be the java-side a serwer side - it's no difference to me so if the soultion written above works it will be cool.
Thx
regards
LucjanLast edited by lipkerson; 11-07-2010 at 11:32 AM.
Similar Threads
-
Names pipes in java
By Zept in forum NetworkingReplies: 2Last Post: 08-06-2011, 08:20 PM -
Putting Java Programs on a DVD
By matt.monkeyboy in forum Advanced JavaReplies: 4Last Post: 04-05-2010, 03:06 AM -
To create sip japenese named files using java
By bngkrish in forum New To JavaReplies: 0Last Post: 04-20-2009, 06:20 PM -
How to use pipes for inter-thread I/O
By Java Tip in forum java.langReplies: 0Last Post: 04-09-2008, 06:37 PM -
named pipes
By samson in forum NetworkingReplies: 1Last Post: 04-04-2007, 06:40 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks