Problems with RPC/XDR on Ultrix 4.0

Problems with RPC/XDR on Ultrix 4.0

Post by Kevin Sambo » Sat, 17 Aug 1991 07:09:52



I am having some trouble with the client of RPC/XDR on Ultrix 4.0.
The server works fine.

I created a small program with rpcgen on a Sun SPARCstation running
SunOS 4.1.1.  This program runs fine on the Sparc and an RS/6000
running AIX 3.1.

These are my problems:
a) the code generated by rpcgen was creating the client handle like
   this:

      static CLIENT *cl = NULL;
      char *server = "astro";

      cl = clnt_create(server, MYPROG, MYVERS, "tcp");

   this produced an unresolved reference to clnt_create().  I did an
   nm on libc.a, and it produced serveral references to clnt_create(),
   but no text.

   Anyway, I replaced it with this code (which I sort of found in the
   SunOS manuals):

      struct sockaddr_in server_addr;
      struct hostent *hp;
      int sock = RPC_ANYSOCK;

      if ((hp = gethostbyname(server)) == NULL) {
         fprintf(stderr, "can't get addr for %s\n", server);
         exit(1);
      }

      bcopy(hp->h_addr, (caddr_t) &server_addr.sin_addr, hp->h_length);
      server_addr.sin_family = AF_INET;
      server_addr.sin_port = 0;

      cl = clnttcp_create(&server_addr, MYPROG, MYVERS, &sock, 0, 0);

   This compiled- which brings me to my next problem:

b) at run-time, after the first call to one of my remote procedures,
   I get:

      xdr_bytes: out of memory

   I have an additional type that is defined like this:

      typedef struct s_client_info {
         char *client_name;
         char *user_name;
      } ClientRec;

   I provide xdr routines that were also generated by rpcgen.

What am I doing wrong, how can errors like this come about (I do not
directly call xdr_bytes), and, are there any books on RPC/XDR
programming?  I know O'Reilly has one, but they are back-ordered till
the end of September.

thanks
kevin samborn

--
kevin samborn                   "Who wrote the XmFileSelect?  Now that's

...!uunet!ezx!samborn                after a chug of Absolut Citron

 
 
 

Problems with RPC/XDR on Ultrix 4.0

Post by Fletcher Kittred » Sat, 17 Aug 1991 23:23:30



>I am having some trouble with the client of RPC/XDR on Ultrix 4.0.
>The server works fine.

....

I don't think DEC claims to support Sun RPC/XDR.  They want you to use
NCS(3) instead.  If you want to use Sun RPC, suck the latest version
off of uunet and support it yourself.

A good book on Sun RPC/XDR is "The Art of Distributed Applicatoins" by
John Corbin.  I think the publisher is Springer-Verlag, but I don't have
the book with me.

regards,
fletcher
/* Fletcher Kittredge
 * BBN Software Products
 * 150 CambridgePark Dr,  Cambridge, MA. 02140

 */

 
 
 

1. RPC 4.0 vs RPC 4.1 vs TI RPC

Hello.

Two quick RPC related questions (from an RPC newbie):

1) I have the source to Sun's RPCSRC4.0 (found using archie). A Sun text -
   "The Art of Distributed Applications" - refers to a newer release
   RPCSRC4.1. However, using archie I am unable to locate this version.

   Does anyone know of this release, and, if so, from where is it available?

2) While archie'ing, I came across TIRPC (the Transport Independent RPC). The
   above Sun text describes TIRPC as working with the TLI (Transport Layer
   Interface) and using STREAMS rather than SOCKETS. Now, I know nothing
   of STREAMS, but could a client built with TIRPC make an RPC call to a server
   built with socket-based RPC (RPCSRC4.0) (assuming that the network
   protocol [TCP/IP or UCP/IP] is the same)?

   The TIRPC states that the code is backwards source compatible, but does
   not mention what to expect when calling a non TI/TLI server (or a client).

   I guess I'm asking if a TIRPC client/server (using STREAMS) work with a
   RPC server/client (using SOCKETS) if using the same network protocol?

Thank you.

Dale Wellborn


Snailnet  :   Dominion Radio Astrophysical Observatory
              P.O. Box 248, Penticton, BC, Canada V2A 6K3
BC Tel net:   (604) 490-4357
Faxnet    :   (604) 493-7767
Sneakernet:   RadioAstron building

Programmer 1: When I started programming, we didn't have any of these sissy
              "icons" and "windows".

              All we had were zeros and ones - and sometimes we didn't have
              ones.

              I wrote an entire database program using only zeros.

Programmer 2: You had zeros? We had to use the letter "O".

 From "Dilbert".

2. Mozilla under KDE...newbie

3. HELP! RPC/XDR decoding problem.

4. Linux on a HP Kayak

5. Slackware directory tree.

6. Problems with XDR and RPC reply messaages (New Posting)

7. Mumps Database on Pyramid Unix DC/OSX

8. HELP! RPC/XDR decoding problem.

9. Problems with su/csh on Ultrix 4.0/DECstation 5000

10. Problem Porting ULTRIX to OSF1/4.0 465 Alpha: more about prob#2

11. Problem Porting Ultrix code to OSF1/4.0 564 alpha

12. RPC/XDR libraries not found