[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Best way to interact with program on Vax?

    Date: Fri, 6 Jul 90 16:03:08 MDT
    From: drstrip@cs.sandia.gov (David R Strip [1411])

    I am writing an application that will need to interact over a period
    of time with another program (solid modeler) running on an Ultrix Vax, or 
    possibly a Sun. What is the best way to do this? Create a new service on the
    vax, or some sort of RPC? I'm new to this, so I'm not sure where to start.
    A skeleton example would be welcome.

If the program on the Vax is normally invoked as a command, the simplest
approach is to use the :UNIX-REXEC service, which is in the UX Support
system (only loaded by default on UX400S systems).  The argument list
for the :unix-rexec service is (command-line &key :user-name :password
(:translation :unix)).  It returns a character stream; writing to the
stream provides standard input for the command, and reading from it gets
you the standard output and error output from the command.

If the Vax program you want to use is a subroutine library, then RPC is
probably the easiest way to implement it.  The Sun RPC and XDR protocols
are provided as part of the NFS implementations on both Genera and
Ultrix.  The Symbolics RPC development facility also provides a way to
keep the Unix server code and the Genera client code together for easier
maintenance.  It's called "Lisp+C" syntax, and it allows you to embed C
code inside Lisp code with #{<C code>} syntax, and you later give a
command that writes all the C code to an Ultrix file, which you then
compile on the Vax.  The Symbolics NFS manual contains reasonable
documentation of this facility.  Alternately, you could use "rpcgen" on
Ultrix to generate the RPC stubs; it should be documented on the Ultrix

Finally, if you don't have Symbolics NFS, and :UNIX-REXEC isn't usable,
then you could define a new TCP protocol specifically for this
application.  This is not easy to teach in a brief email message
(designing a protocol is like designing a program), so I'm not even
going to try.  The Symbolics "Networks" manual provides pretty good
documentation on implementing protocols using the Genera networking
software, but nothing about designing protocols.  Try going to a good
technical bookstore or library and see if you can find a textbook on
TCP/IP networking that describes protocol design (watch out -- most
books on networking talk about network implementation, which would be
about as useful to you as a book on compiler implementation would be to
someone learning how to program).