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

RPC Initialization



   Date: Wed, 28 Aug 91 13:39:48 +0900
   From: kddlab!atr-la.atr.co.jp!myers@uunet.UU.NET (John K. Myers)

   I have three LMs: an XL, a 3620, and a MacIvory.  I want any machine
   to be able to send data to, or run functions remotely on, any other
   specified machine.

   This appears to be a job for RPC.  Based on previous discussions,
   someone suggested I open a connection using
     (setq *LM05-link* (rpc:open-tcp-agent "LM05"))

It is a matter of taste, but personally I think TCP is overkill for RPC
which is a typical connectionless protocol.

   and then use 
     (execute-my-remote-function args more-args :transport-agent *LM05-link*)
   to invoke the RPC, after having gone through the mess of defining    
   the remote-module and the remote-entry.

   The current problem is that I get the following error message:
   Error: LM25 does not support RPC service.

   The following specials have been rebound; use :Show Standard Value Warnings for details:
     *PRINT-LEVEL*

   NET:FIND-PATHS-TO-SERVICE-ON-HOST
      Arg 0 (NETI:SERVICE): :RPC
      Arg 1 (NET:HOST): #<FS:LISPM-HOST LM25 22005606115>
      Arg 2 (NETI:ONLY-NEED-BEST): NIL
      Arg 3 (NETI:MUST-HAVE-ONE): T
   s-A:           Use protocol RPC-LITTLE-ENDER on medium TCP, or RPC on TCP.
   etc.

   when I try to open the tcp agent.  If I do a s-A, things seem
   to work O.K., but it apparently is using a different protocol than
   TCP (not that I understand nor care).

Is it really? Are you sure?

   Q: How can I get the program to init the RPC behavior without breaking
   out into an error message?  For instance, is there a function that I can
   call directly that sets up a "RPC-LITTLE-ENDER" protocol for me?
   Or is there some magic file that I have to edit to let one Symbolics know
   that another Symbolics has RPC capability?  Or should I use
   (setq *LM25-link* (rpc:open-chaos-agent "LM25"))?

Use the namespace database. Add a new Service attribute for the
machine(s) you want to RPC to. Typically something like (from the top of
my head - the details might be slightly incorrect):

Service: RPC (Medium) TCP (Protocol) RPC-LITTLE-ENDER

The CP command "Add Service to Host" (or something like it) could be
useful too.

   Q: I assume that I can simply call rpc:open-tcp-agent once at the beginning
   of the month, and then have that connection remain valid as long as 
   both machines are running.  Obviously, if I boot the sending machine,
   the connection dies.  What happens if I boot the receiving machine--
   is the connection established from the sending machine still valid?
   What happens if I power-down the MacIvory, and then turn it on again
   (same world)--are connections sent from the Mac still valid?  How about
   connections being received into the Mac?

Typical problems related to connection-oriented transports like TCP. In
my opinion: Use UDP instead and implement the kind of error-handling you
need yourself - it is really not so difficult, at least not in Lisp
under Genera.

   Q: If I use a chaos protocol, can I send strings containing Kanji
   and carriage-returns from one Symbolics to another?  On p.64 of the #13 Networks
   manual, it says that strings should only use the 95 nice printable ASCII characters.
   I couldn't get variable-length "opaque-byte" Kanji strings to work.

I suggest you utilise the Lisp reader (server) and printer (client) to
take care of these petty details. Just make the client send the
neccessary info to enable the server to reconstruct your data structure
at the server side. It might be inefficient, allright, but at least you
don't have to spend the rest of the month (re)inventing some dubious
conventions for transferring data over the net.


Eyvind Ness
eyvind@hrp.no

In case you've lost it - here is the *standard* RPC set-up (client) on a
Symbolics running Genera 8.1, or 8.0 with TCP/IP and NFS sent out to
slug Aug 15, not the call to RPC:HOST-UDP-TRANSPORT-AGENT:

(rpc:define-remote-module
  program-name                          ;symbol
  (:number program-number)              ;as above
  (:version version-number)             ;as above
  (:client :lisp))                      ;tells Genera to make client stub

(rpc:define-remote-entry
  procedure-name                        ;symbol
  program-name
  (:number procedure-number)
  (:arguments
    (query string))
  (:values
    (reply string)))

;;; example call:
(procedure-name 
  "query"
  :transport-agent
  (rpc:host-udp-transport-agent (net:parse-host host-name)))

;;; End of example.