svc_tli_create()--Create a Server Handle


  Syntax

 #include <rpc/rpc.h>
 #include <netconfig.h>

 SVCXPRT svc_tli_create(const int fildes,
                         const struct netconfig
                             *netconf,
                         const struct t_bind
                             *bindaddr,
                         const u_int sendsz,
                         const u_int recvsz);

  Service Program Name: QZNFTRPC

  Default Public Authority: *USE

  Threadsafe: No

The svc_tli_create() function creates an RPC server handle.


Parameters

fildes  (Input) 
The file descriptor on which the service is listening. The only permitted value for a user application is RPC_ANYFD. If the file descriptor fildes is RPC_ANYFD, it opens a file descriptor on the transport specified by netconf.

netconf  (Input) 
The transport protocol.

bindaddr  (Input) 
The address where fildes is bound if it is unbound.

sendsz  (Input) 
The size of the send buffer. When a value of zero is specified, a suitable default value will be chosen by the system.

recvsz  (Input) 
The size of the receive buffer. When a value of zero is specified, a suitable default value will be chosen by the system.

Authorities

No authorization is required.


Return Value



Error Conditions



Error Messages



Related Information


Example

The following example shows how svc_tli_create is used.

Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.

/* Define remote program number and version */
#define RMTPROGNUM (u_long)0x3fffffffL
#define RMTPROGVER (u_long)0x1

#include <stdio.h>
#include <rpc/rpc.h>
#include <netconfig.h>

main()
{
  SVCXPRT *svc;
  struct netconfig *nconf;
  int fd;

  ...
  /* Returns a pointer to nconf corresponding to UDP */
  if ((nconf = getnetconfigent("UDP")) ==
               (struct netconfig *)NULL) {
    fprintf(stderr, "Cannot get netconfig entry for UDP\n");
    exit(1);
  }

  ...

  svc = svc_tli_create(RPC_ANYFD,nconf,
                                  (struct t_bind *)NULL,
                                  0, 0);
  if (svc == (SVCXPRT *)NULL){
    fprintf(stderr, "svc_tli_create failed!!\n");
    exit(1);
  }

  ...

}


API introduced: V4R2

[ Back to top | Remote Procedure Call (RPC) APIs | APIs by category ]