Creates a remote procedure call (RPC) service handle for connection-oriented transport.
Network Services Library (libnsl.a)
#include <rpc/rpc.h>
 SVCXPRT *svc_vc_create(fd, sendsize, recvsize)
int fd;
const uint_t sendsize;
const uint_t recvsize;
The svc_vc_create subroutine is a bottom-level API for transport-independent remote procedure calls (TI_PRC). Bottom-level APIs provide a full control over the transport options. This subroutine creates an RPC service handle for connection-oriented transport. This subroutine does not register a server with an RPC service package because the program number and version number are not specified.
| Item | Description | 
|---|---|
| fd | Indicates an open file descriptor that is bound. | 
| sendsize | Specify the send buffer size. If the value is set to 0, the default size for that transport is used. | 
| recvsize | Specify the receive buffer size. If the value is set to 0, the default size for that transport is used. | 
| Item | Description | 
|---|---|
| an PRC service handle | successful | 
| NULL | unsuccessful | 
#include <stdlib.h>
#include <rpc/rpc.h>
main()
{
       SVCXPRT *svc_handle;      /* server handle */
       int fd;                   /* file descriptor */
 
       /* Get proper file descriptor */                     
  
       /* sendsize and recvsize are 0, thus default size will be chosen */
                     
       if((svc_handle = svc_vc_create(fd, 0, 0))==(SVCXPRT *)NULL)
       {
                 fprintf(stdout,"Error in svc_vc_create!");
                 exit(EXIT_FAILURE);
       }
  
       /* Register RPC service */
              
       svc_run();
       return 0;
}