PDA

View Full Version : Sending messages between processes




rinseout
Jun 21, 2005, 05:23 PM
Say I have two interactive console-mode applications written in C++.

1) Is there a portable way (in the sense of common UNIX-ish platforms) to send a data structure from the first program to the second, which processes the data structure in some fashion and then waits for the next one?

2) Assuming the answer to 1) is "yes", how hard is this to implement?

3) Assuming the answer to 2) is "not very", then is there a good article that goes through this stuff?

I really don't have time to get really into a(nother) complicated programming issue, but if there's a simple way of doing this, it would make my life easier.

Thanks for any advice.



caveman_uk
Jun 22, 2005, 04:15 AM
Not that I know much about this but will pipes work?

ChrisBrightwell
Jun 22, 2005, 05:28 AM
Here's the first hit off Google for "UNIX IPC":

http://www.ecst.csuchico.edu/~beej/guide/ipc/

rinseout
Jun 22, 2005, 01:13 PM
Here's the first hit off Google for "UNIX IPC":

http://www.ecst.csuchico.edu/~beej/guide/ipc/
Cheers that's great.

peterparker
Jun 22, 2005, 01:21 PM
Knowing a moderate amount of C and reading the above link, it looks like named pipes or Unix sockets would both be good choices.