-
February 10th, 2005, 05:11 PM
#1
linux C/C++ pipes programming
Hi everyone,
This is my first post in these forums so welcome everybody.
I don't know if what i want is by any means possible. Here's the whole deal. I am writting a plugin for another program, and for that plugin to work correctly i needed to be able to receive some data from another app. So basically what i wanted to achieve is to call some other app from my plugin and then get data back into my process.
Do you think this is possible? is the only/best way to use temp files?
Thanks in advance for all your time and help.
Cheers,
Alex Paes
-
February 10th, 2005, 05:48 PM
#2
Re: linux C/C++ pipes programming
Originally Posted by AlexPaes
Do you think this is possible? is the only/best way to use temp files?
nope, you can use the BSD Sockets and communicate via TCP. TCP/IP requests made on the loopback interface (local machine) are as fast, if not faster than writing to a file.
Welcome aboard...
-
February 10th, 2005, 06:00 PM
#3
Re: linux C/C++ pipes programming
Thanks for such a fast reply,
I neved did that kind of stuff, maybe you can point me some nice places where i can look for more information on how i can implement that?
Thanks,
Alex Paes
-
February 11th, 2005, 04:12 PM
#4
Re: linux C/C++ pipes programming
-
February 15th, 2005, 05:40 AM
#5
Re: linux C/C++ pipes programming
Hi,
Thanks a lot for your help, i have gathered quite some material. Now, on to study...
cheers,
AlexPaes
-
February 15th, 2005, 11:04 AM
#6
Re: linux C/C++ pipes programming
Hold on!
Before you use TCP/IP, you might want to look into some system calls for setting up a pipe.
Check out the following system calls:
int pipe(int fifo[2]);
dup();
dup2();
fcntl();
The shell uses some of these for redirecting input/output to a process, and you can use the same...
I don't know which will be easier (these or TCP/IP)
Try to find more info in the UNIX man pages - man system_call or K->Help->Unix Manual Pages->System Calls.
If you just want to get the data from the other program, and all at once, temp files may be the easier solution...
-
February 15th, 2005, 12:15 PM
#7
Re: linux C/C++ pipes programming
Hi,
Actually i don't want to pass info all at once and i need to pass the data from one program to another as it becomes available. So i think pipes are not the way to do it, i believe the best way is actually through sockets.
I just need to get them running
Btw, is the listen() just a single call or will it keep listening for any period of time? I mean in order to catch incoming connections i believe i will need to get that listen in some while or for cycle, is this right?
Thanks to all for the help,
Alex Paes
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|