Results 1 to 8 of 8
Thread: intercept a c++ IO pipeline??
- 10-14-2011, 04:36 PM #1
Member
- Join Date
- Oct 2011
- Posts
- 4
- Rep Power
- 0
intercept a c++ IO pipeline??
Hello,
I dont quite know if this is the right place but since it said Synchronization i thought i'll post this here.
for a college project i had to make 2 programs that connect to each other through sockets. a chat client/server.
after i did this they gave me another assignment saying i need to build a GUI with java and then make it run the c++ client and intercept the I/O pipeline to read and send data.
I looked up on the internet how to do this for a while now and there seems to be NO information regarding this problem.
Can anyone point me in the right direction? At the moment i'm trying to figure out how to set up all of this (i have no knowledge of how to do any of what i just described). And since im getting limited guidance asking through college is gonna take a long time.
any help is really reaaally appreciated!
- 10-15-2011, 02:25 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 14,422
- Blog Entries
- 7
- Rep Power
- 29
Re: intercept a c++ IO pipeline??
If your C++ process communicates through its streams stdin and stdout (and optionally stderr?) things are easy: in Java you can get the counterparts of those streams and read and write from/to them. Read the API documentation for the Process class. If your C++ process communicates through named pipes you can open those pipes as if they were files and read/write from/to them ...
kind regards,
JosBuild a wall around Donald Trump; I'll pay for it.
- 10-15-2011, 02:43 PM #3
Member
- Join Date
- Oct 2011
- Posts
- 4
- Rep Power
- 0
Re: intercept a c++ IO pipeline??
thanks for replying so quick Jos. i looked up some things on the internet and i use sockets (#include <WinSock2.h>) to make my connection with the server.
would your method still be applicable? anywho im gonna try to see if ur tip leads me anywhere and i'll update you when i've figured something out.
- 10-15-2011, 03:17 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 14,422
- Blog Entries
- 7
- Rep Power
- 29
Re: intercept a c++ IO pipeline??
Build a wall around Donald Trump; I'll pay for it.
- 10-15-2011, 03:25 PM #5
Member
- Join Date
- Oct 2011
- Posts
- 4
- Rep Power
- 0
Re: intercept a c++ IO pipeline??
yes that would be the way i would go for but after asking my teacher he specifically told me not to use the java sockets but to "intercept the c++ program's IO pipeline" and send/receive messages through there. I'm actually starting to doubt this is actually possible due to the lack of information about this on the internet lol.
- 10-15-2011, 03:30 PM #6
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 14,422
- Blog Entries
- 7
- Rep Power
- 29
- 10-15-2011, 09:08 PM #7
Member
- Join Date
- Oct 2011
- Posts
- 4
- Rep Power
- 0
Re: intercept a c++ IO pipeline??
I did and he clarified some things for me and even gave me a link to the problem i was facing!
In case you're wondering what it was exactly i was looking for: How to run command-line or execute external application from Java | Linglom.com
and i'll need to use JNI to call functions from within the external application.
Thanks for your help on sockets and pipelines. I know i'll come across a situation where i'll need to apply the method u described in the posts above.
Similar Threads
-
intercept ! SET library
By nigamsir in forum NetworkingReplies: 0Last Post: 03-20-2010, 05:34 AM -
Finding the intercept using two equations.
By MapleLeafRag in forum New To JavaReplies: 1Last Post: 12-03-2009, 08:32 PM -
Intercept key type
By carderne in forum New To JavaReplies: 3Last Post: 07-23-2009, 02:57 PM -
Intercept CVS/SVN team commit
By dilipg003 in forum EclipseReplies: 2Last Post: 05-12-2009, 06:17 PM -
Data Pipeline Released
By dele in forum Java SoftwareReplies: 0Last Post: 06-28-2007, 03:29 AM
Bookmarks