home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / sgi / 12730 < prev    next >
Encoding:
Internet Message Format  |  1992-08-21  |  2.6 KB

  1. Xref: sparky comp.sys.sgi:12730 comp.unix.wizards:3668
  2. Path: sparky!uunet!dtix!darwin.sura.net!jvnc.net!nj.nec.com!cliff
  3. From: cliff@research.nj.nec.com (yep just another Xer)
  4. Newsgroups: comp.sys.sgi,comp.unix.wizards
  5. Subject: can you set timeout on portmapper clnt_create() ?
  6. Summary: want to query random hosts with RPC without waiting
  7. Keywords: rpc clnt_create portmap timeout
  8. Message-ID: <1992Aug21.180443.14707@research.nj.nec.com>
  9. Date: 21 Aug 92 18:04:43 GMT
  10. Sender: news@research.nj.nec.com
  11. Organization: NEC Research Institute
  12. Lines: 38
  13. Originator: cliff@magic
  14.  
  15. hi,
  16. i'm writing some packet analyzer/statistics-gathering code.  i am trying
  17. to identify packet types down to the rpc level (i.e. nfs, ypserv, etc.).
  18. to do this i make a query to the portmapper of each new host that appears
  19. as a source of new packets, and essentially what i want is to call
  20. pmap_getmaps().  however, we have a heterogenous network with some PC's
  21. and Macs on it, and although these machines talk telnet and ftp, they
  22. don't talk rpc (and hence have no portmapper to talk to).  so the program
  23. hangs whenever a PC or Mac sends a packet, because the program tries
  24. to establish a connection with the portmapper on the remote host, which
  25. of course doesn't exist on PC's/Macs.
  26.  
  27. i know, one way to avoid this is to not make the portmap call to the PC/Mac.
  28. but what i'd really like to do is to be able to just have a timeout (say
  29. just 2 seconds instead of the default 25 [who set *that* value anyway??])
  30. to the call so that if the client doesn't answer, the program can just
  31. ignore that host and continue functioning.  also, i'll need this in case
  32. i get into a situation of trying to contact the portmapper of a UNIX host
  33. that just crashed.
  34.  
  35. i tried to do this, unsuccessfully, by using the "middle level" of rpc,
  36. with a statement such as cl=clnt_create(argv[1],PMAP_PROG,PMAP_VERS,"udp").
  37. however, i don't see any way to establish a timeout on the initial
  38. client creation.
  39.  
  40. do i have to go all the way down to XDR (ugh!) or am i already making
  41. the code to complicated?  this is my first time programming RPC, so it's
  42. not too clear if i'm going in the right direction.  i succeeded in writing
  43. a program that duplicates /usr/etc/rpcinfo -p host, but that just uses
  44. the default interface pmap_getmaps().  clnt_create() works fine if the
  45. host has a portmapper, but hangs otherwise.
  46.  
  47. please route any suggestions to cliff@research.nj.nec.com.  thanks.
  48. -- 
  49. --
  50. cliff@research.nj.nec.com    609-951-2688    fax 609-951-2482
  51. [Cliff Miller, 80% RA, 20% ESA (research associate & ergodic systems-analyst)]
  52. NEC Research Institute, 4 Independence Way, Princeton NJ 08540
  53.