Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ svc_raw_create(3N) — svr4 — mips UMIPS RISC/os 5.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

rpcbind(1M)

rpc(3N)

rpc_svc_calls(3N)

rpc_svc_err(3N)

rpc_svc_reg(3N)



RPCSVCCR(3N-SVR4) RISC/os Reference Manual  RPCSVCCR(3N-SVR4)



NAME
     rpc_svc_create:  svc_create, svc_destroy, svc_dg_create,
          svc_fd_create, svc_raw_create, svc_tli_create,
          svc_tp_create, svc_vc_create - library routines for
          dealing with the creation of server handles

DESCRIPTION
     These routines are part of the RPC library which allows C
     language programs to make procedure calls on servers across
     the network.  These routines deal with the creation of ser-
     vice handles.  Once the handle is created, the server can be
     invoked by calling svc_run.

   Routines
     See rpc(3N) for the definition of the SVCXPRT data struc-
     ture.

     #include <rpc/rpc.h>

     int
     svccreate(
          const void (*dispatch)(const struct svcreq *, const SVCXPRT *),
          const ulong prognum, const ulong versnum,
          const char *nettype);

          svccreate creates server handles for all the tran-
          sports belonging to the class nettype.

          nettype defines a class of transports which can be used
          for a particular application.  The transports are tried
          in left to right order in NETPATH variable or in top to
          down order in the netconfig database.

          If nettype is NULL, it defaults to netpath.  svccreate
          registers itself with the rpcbind service [see
          rpcbind(1M)].  dispatch is called when there is a
          remote procedure call for the given prognum and vers-
          num; this requires calling svc_run [see svc_run in
          rpc_svc_reg(3N)].  If it succeeds, svccreate returns
          the number of server handles it created, otherwise it
          returns 0 and the error message is logged.

     void
     svcdestroy(SVCXPRT *xprt);

          A function macro that destroys the RPC service tran-
          sport handle xprt.  Destruction usually involves deal-
          location of private data structures, including xprt
          itself.  Use of xprt is undefined after calling this
          routine.





                        Printed 11/19/92                   Page 1





RPCSVCCR(3N-SVR4) RISC/os Reference Manual  RPCSVCCR(3N-SVR4)



     SVCXPRT *
     svcdgcreate(const int fd, const uint sendsz, const uint recvsz);

          This routine creates a connectionless RPC service han-
          dle, and returns a pointer to it.  This routine returns
          NULL if it fails, and an error message is logged.
          sendsz and recvsz are parameters used to specify the
          size of the buffers.  If they are 0, suitable defaults
          are chosen.  The file descriptor fd should be open and
          bound.

          Warning:  since connectionless-based RPC messages can
          only hold limited amount of encoded data, this tran-
          sport cannot be used for procedures that take large
          arguments or return huge results.

     SVCXPRT *
     svcfdcreate(const int fd, const uint sendsz, const uint recvsz);

          This routine creates a service on top of any open and
          bound descriptor, and returns the handle to it.  Typi-
          cally, this descriptor is a connected file descriptor
          for a connection-oriented transport.  sendsz and recvsz
          indicate sizes for the send and receive buffers.  If
          they are 0, a reasonable default is chosen.  This rou-
          tine returns NULL, if it fails, and an error message is
          logged.

     SVCXPRT *
     svcrawcreate(void);

          This routine creates a toy RPC service transport, to
          which it returns a pointer.  The transport is really a
          buffer within the process's address space, so the
          corresponding RPC client should live in the same
          address space; [see clnt_raw_create in
          rpc_clnt_create].  This routine allows simulation of
          RPC and acquisition of RPC B overheads (such as round
          trip times), without any kernel interference.  This
          routine returns NULL if it fails, and an error message
          is logged.
          B

     SVCXPRT *
     svctlicreate(const int fd, const struct netconfig *netconf,
          const struct tbind *bindaddr, const uint sendsz,
          const uint recvsz);

          This routine creates an RPC server handle, and returns
          a pointer to it.  fd is the file descriptor on which
          the service is listening. If fd is RPC_ANYFD, it opens
          a file descriptor on the transport specified by



 Page 2                 Printed 11/19/92





RPCSVCCR(3N-SVR4) RISC/os Reference Manual  RPCSVCCR(3N-SVR4)



          netconf.  If the file descriptor is unbound, it is
          bound to the address specified by bindaddr, if bindaddr
          is non-null, otherwise it is bound to a default address
          chosen by the transport.  In the case where the default
          address is chosen, the number of outstanding connect
          requests is set to 8 for connection-oriented tran-
          sports.  The user may specify the size of the send and
          receive buffers with the parameters sendsz and recvsz;
          values of 0 choose suitable defaults.  This routine
          returns NULL if it fails, and an error message is
          logged.

     SVCPRT *
     svctpcreate(const void (*dispatch)(const RQSTP *, const SVCXPRT *),
          const ulong prognum, const ulong versnum,
          const struct netconfig *netconf);

          svc_tp_create creates a server handle for the network
          specified by netconf, and registers itself with the
          rpcbind service.  dispatch is called when there is a
          remote procedure call for the given prognum and vers-
          num; this requires calling svc_run.  svc_tp_create
          returns the service handle if it succeeds, otherwise a
          NULL is returned, and an error message is logged.

     SVCXPRT *
     svcvccreate(const int fd, const uint sendsz, const uint recvsz);

          This routine creates a connection-oriented RPC service
          and returns a pointer to it.  This routine returns NULL
          if it fails, and an error message is logged.  The users
          may specify the size of the send and receive buffers
          with the parameters sendsz and recvsz; values of 0
          choose suitable defaults.  The file descriptor fd
          should be open and bound.

SEE ALSO
     rpcbind(1M), rpc(3N), rpc_svc_calls(3N), rpc_svc_err(3N),
     rpc_svc_reg(3N).
















                        Printed 11/19/92                   Page 3



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026