#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);
The svc_tli_create() function creates an RPC server handle.
No authorization is required.
xprt | Upon successful completion, this function returns a pointer to the created RPC server handle. |
NULL | svc_tli_create() was not successful. The errno variable is set to indicate the reason. |
[ENOMEM] | Out of memory. |
[EUNKNOWN] | Unknown system state. |
[EADDRNOTAVAIL] | Address not available. This value is set when bindaddr is rejected by the transport layer. |
[EIO] | Input/output error. This value is set as a result of network transport failure. It indicates that RPC cannot handle an error that occurred in lower transport levels. |
[EACCES] | Permission denied. |
[EBADF] | Bad file descriptor. This value is set when the fildes parameter is not valid or cannot be used as a transport endpoint. |
[EFAULT] | The address used for a bindaddr was not available. |
[ENOBUFS] | There is not enough buffer space available for the API. |
[EINVAL] | An invalid value was supplied for the input parameter nconf. |
[EADDRINUSE] | Local address is in use. This value is set when fildes cannot be bound to any local address. |
Message ID | Error Message Text |
---|---|
CPIA1B2 I | TI-RPC encountered a problem in the transport protocol. |
CPIA1B3 I | TI-RPC encountered a problem in the server. |
CPF3CF2 E | Error(s) occurred during running of &1 API. |
CPF9872 E | Program or service program &1 in library &2 ended. Reason code &3. |
See Code disclaimer information for information pertaining to code examples.
The following example shows how svc_tli_create is used:
/* 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); } ... }
Top | Remote Procedure Call (RPC) APIs | APIs by category |