[comp.unix.questions] Portable inter process communications.

ruiu@tic.UUCP (Dragos Ruiu) (11/02/87)

I hate to open this can of worms....
	Is there a *portable* way to get two processes to communicate, some
method that has a hope of working under SysV, BSD, HP-UX and the plethora of
weird beasties in Unix land ? Are named pipes the answer ? Are files the last
resort ?
 
     Barring that is there a method that will work on all SysV (V.2 V.3 ..)?
     Or is there a method to intercept *all* output to a tty so that a useable 
version of the VMS Phone utility may be written for Unix. Write's using "over"
seems like a barbaric way for unix users to chat - a public-domain, full screen
Phone would be much better.

I'll try to summarize all mail replies.

Dragos Ruiu  ...ihnp4!alberta!edson!tic!dragos!work
             Voice: (403) 432-0090
Inside every small problem there is a large problem struggling to get out.

richard@islenet.UUCP (Richard Foulk) (11/04/87)

>  
>      Barring that is there a method that will work on all SysV (V.2 V.3 ..)?
>      Or is there a method to intercept *all* output to a tty so that a useable 
> version of the VMS Phone utility may be written for Unix. Write's using "over"
> seems like a barbaric way for unix users to chat - a public-domain, full screen
> Phone would be much better.
> 

A small mod to write(1) to make it use cbreak (or whatever) mode is
much better than chat or talk or any of the others I've seen.  It's
simple and easy to follow, no over's or o-o's necessary.

The bsd talk(1) is cute but it's a pain to follow with the cursor
jumping back and forth.  And it's impossible to reconstruct the
conversation by looking at the screen.






-- 
Richard Foulk		...{dual,vortex,ihnp4}!islenet!richard
Honolulu, Hawaii

allbery@ncoast.UUCP (Brandon Allbery) (11/07/87)

As quoted from <143@tic.UUCP> by ruiu@tic.UUCP (Dragos Ruiu):
+---------------
| I hate to open this can of worms....
| 	Is there a *portable* way to get two processes to communicate, some
| method that has a hope of working under SysV, BSD, HP-UX and the plethora of
| weird beasties in Unix land ? Are named pipes the answer ? Are files the last
| resort ?
|  
|      Barring that is there a method that will work on all SysV (V.2 V.3 ..)?
+---------------

Named pipes (FIFOs) work in System III and System V.  Under 4.xBSD, you can
get the equivalent of a named pipe by getting a socketpair and calling bind()
to attach it to a filename.  (Think of bind() as flink(), i.e. link a file
descriptor into the filesystem; but it only works on sockets, I believe.)
This would allow an ALMOST-portable technique, since the only machine
depent code is to do a mknod(name, ...|S_IFIFO) under USG or socket() and
bind() under BSD.
-- 
Brandon S. Allbery		     necntc!ncoast!allbery@harvard.harvard.edu
 {harvard!necntc,well!hoptoad,sun!mandrill!hal,uunet!hnsurg3}!ncoast!allbery
Moderator of comp.sources.misc