Creates and returns a generic client handle for a program over the doors-transport mechanism.
Network Services Library (libnsl.a)
#include <rpc/rpc.h>
CLIENT * clnt_door_create(prognum, versnum, sendsize)
const rpcprog_t prognum;
const rpcvers_t versnum;
const uint_t sendsize;
The clnt_door_create subroutine creates and returns a generic client handle for the specified program and version. The subroutine creates the client handle over the doors-transport mechanism that can accelerate the data transfer between different processes on the same machine. If you set the size of the send buffer that is specified by the sendsize parameter to 0, the default size of 16KB is used.
Item | Description |
---|---|
prognum | Specifies the program number of the remote program. |
versnum | Specifies the version number of the remote program. |
sendsize | Specifies the size of the send buffer. |
Item | Description |
---|---|
a generic client handle that is valid | successful |
NULL | unsuccessful |
The clnt_door_create subroutine returns failure when one or more of the following codes are true.
Item | Description |
---|---|
RPC_UNKNOWNHOST | The host name is not valid. |
RPC_PROGVERSMISMATCH | The version number is not valid. |
#include <stdlib.h>
#include <rpc/rpc.h>
int main()
{
CLIENT *cl;
rpcprog_t PROGNUM = 0x3fffffffL;
rpcvers_t PROGVER = 0x1L ;
/*
* make the clnt_door_create call with this nettype and
* observe the result
*/
if ((cl=clnt_door_create( PROGNUM, PROGVER, 0)) == NULL)
{
fprintf(stdout, "clnt_door_create : failed.\n");
exit(EXIT_FAILURE);
}
/*
* Make a call to clnt_call() subroutine
*/
/* Destroy the client handle in the end */
clnt_destroy(cl);
return 0;
}