How can communicate between another programs on linux.

How can communicate between another programs on linux.

Post by á???± » Fri, 06 Dec 1996 04:00:00



While making a C program on linux system, I faced a problem.

That's a communication between process.

For example, 'user1' runs a program named 'prog1' and different user
'user2' runs a program named 'prog2' on the same linux system. 'prog1' and
'prog2' needs exchange their data each other.

I stand on this situation. I want exchange data between my three or more
programs which runs simultaneously. I want to know how can exchange the
data betweem program.

I'll waiting for your answer. Thank you.

 
 
 

How can communicate between another programs on linux.

Post by James Youngm » Fri, 06 Dec 1996 04:00:00



says...

Quote:

>While making a C program on linux system, I faced a problem.

>That's a communication between process.

>For example, 'user1' runs a program named 'prog1' and different user
>'user2' runs a program named 'prog2' on the same linux system. 'prog1' and
>'prog2' needs exchange their data each other.

>I stand on this situation. I want exchange data between my three or more
>programs which runs simultaneously. I want to know how can exchange the
>data betweem program.

>I'll waiting for your answer. Thank you.

Buy a copy of "Advanced Programming in the Unix Environment" by Richard
Stevens, which explains all the options, contains example code, and is the best
book on the subject.

--
James Youngman       VG Gas Analysis Systems |The trouble with the rat-race
 Before sending advertising material, read   |is, even if you win, you're
http://www.law.cornell.edu/uscode/47/227.html|still a rat.

 
 
 

How can communicate between another programs on linux.

Post by K O » Sat, 07 Dec 1996 04:00:00



>While making a C program on linux system, I faced a problem.

>That's a communication between process.

>For example, 'user1' runs a program named 'prog1' and different user
>'user2' runs a program named 'prog2' on the same linux system. 'prog1' and
>'prog2' needs exchange their data each other.

>I stand on this situation. I want exchange data between my three or more
>programs which runs simultaneously. I want to know how can exchange the
>data betweem program.

>I'll waiting for your answer. Thank you.

        Another good book is Beginning Linux Programming by Wrox.
 
 
 

How can communicate between another programs on linux.

Post by Keith M. Luca » Sat, 07 Dec 1996 04:00:00




>While making a C program on linux system, I faced a problem.

>That's a communication between process.

>For example, 'user1' runs a program named 'prog1' and different user
>'user2' runs a program named 'prog2' on the same linux system. 'prog1' and
>'prog2' needs exchange their data each other.

>I stand on this situation. I want exchange data between my three or more
>programs which runs simultaneously. I want to know how can exchange the
>data betweem program.

>I'll waiting for your answer. Thank you.

The magic word you're looking for is "socket".

Basically you want the programs to try and open a port ( which is a
numbered service.. for example HTTP takes place on one port, NNTP on
another etc. ) If they can't open the port to be a server they assume
one of their friend processes has already nabbed it ( and is being the
server ) so they call it. ( like making a phone call ).

The end result of "bind", and "socket" and "fdopen" and a few other
system calls is that you get a "File *" to which you can read and
write. The difference is that the data you "fputs" in from one process
can then be "fgets" in the other end.

The server can have multiple connections open, so A can open the port,
B tries to open the port, fails since A's got it, and then calls A. C
does the same. B can now talk to C by passing data to A who sends it
to everyone or delivers it by means of a message header ( B says "send
this to C: Boo!" to A ).

Sounds complex, but in practice it's delightfully simple, contrast
with the difficulties that Windows goes through attempting to do
things like this -- oodles of protocols and hacks and kludges.

Oh, the other advantage is that this will run over networks -- A, B
and C need not necessarily even be running on the same machine !!

You want to look at rtfm.mit.edu and see what you can find in the way
of documentation for BSD sockets or get a book which covers it.

 -----------------------------------------------------------------------------

          Current project: Computer war*'s next generation...
 ------------------------------------------------------------------------------

 
 
 

How can communicate between another programs on linux.

Post by scotta.. » Tue, 10 Dec 1996 04:00:00


Another option is thru the use of named pipes - these are basically fifo
structures (see man on mkfifo).

Or if the communication is simple, by writing to disk files.  This is not
as bad as it sounds as information is generally stored in memory and then
synced out to disk. You may have deleted the information by that time.

 
 
 

1. Q: LINUX/PC COMMUNICATING PROGRAMMING QUESTIONS. HELP!!!

Hi, Netters:

My home PC(486) runs Linux. I would like to learn writing a telecommunication
program running under Linux/Unix environment. The program should be able to
take dial-in calls from remote PC's through modems and comunicate with them.
On the remote PC sites, I do have some programs,such as Telix, to use.
My following questions concern the Unix/Linux site.

(1)  Is there any public domain software with C/C++ source code to do this
kind of job? Or if you have some kind of experience and would kindly like
to share with me or refer me to a good reference book, please drop me an
e-mail.

(2) How does multi-calls(lines) work? How do I impliment that in the program?
Usually a PC has 2 serial ports. I heard about multi-port device, but don't
know how that works. Does the number of serial port interrupts limit the
number of serial ports that you can add to a PC? How does a regular unix
workstation,e.g. Sun Sparc, RS/6000, etc. take care of the multi-calls(lines)?

Any replies will be greatly appreciated.

Thanks in advance.

Binglin Yang

2. X configuration

3. Writing a Mac program to communicate with a Cray

4. SCO5.0.5 and ftpd

5. Program that communicates with a secure web server?

6. Xfree and Toshiba 720 CDT graphic troubles

7. communicating with Fortran program via named pipe

8. RDMS

9. Looking for a program that can communicate with a GPS reciever

10. Communicating with a NT program ?

11. FTP client inside linux firewall communicating with FTP server inside another linux firewall

12. FTP server behind linux firewall communicating w/ FTP behind linux firewall

13. It's not bad canned meat...