rpc_soc.3n (2010 09)
r
rpc_soc(3N) rpc_soc(3N)
(OBSOLETE)
descriptor, which may be open and bound. If it is
RPC_ANYSOCK, then this routine opens a
new one and sets *fdp . Refer to the File Descriptor section for more information. The UDP
transport resends the call message in intervals of wait time until a response is received or
until the call times out. The total time for the call to time out is specified by
clnt_call()
(see rpc_clnt_calls(3N)). If successful it returns a client handle, otherwise it returns NULL.
The error can be printed using the
clnt_pcreateerror()
(see rpc_clnt_create(3N)) rou-
tine.
The user can specify the maximum packet size for sending and receiving by using sendsz and
recvsz arguments for UDP-based RPC messages.
If addr
→sin_port is 0 and the requested version number versnum is not registered with the
remote portmap service, it returns a handle if at least a version number for the given program
number is registered. The version mismatch is discovered by a
clnt_call() later (see
rpc_clnt_calls(3N)).
Warning: this routine exists for backward compatibility only.
clnt_tli_create()
or
clnt_dg_create()
(see rpc_clnt_create(3N)) should be used instead.
CLIENT *clntudp_create()
This routine creates an RPC client handle for the remote program prognum , version versnum ;
the client uses UDP/IP as a transport. The remote program is located at Internet address
addr.Ifaddr
→sin_port is 0, then it is set to the actual port that the remote program is listen-
ing on (the remote rpcbind service is consulted for this information). The parameter *fdp is
a file descriptor, which may be open and bound; if it is
RPC_ANYSOCK, then this routine opens
a new one and sets *fdp . Refer to the File Descriptor section for more information. The UDP
transport resends the call message in intervals of wait time until a response is received or
until the call times out. The total time for the call to time out is specified by
clnt_call()
(see rpc_clnt_calls(3N)). clntudp_create()
returns a client handle on success, otherwise
it returns NULL. The error can be printed using the
clnt_pcreateerror()
(see
rpc_clnt_create(3N)) routine.
Since UDP-based RPC messages can only hold up to 8 Kbytes of encoded data, this transport
cannot be used for procedures that take large arguments or return huge results.
Warning: this routine exists for backward compatibility only.
clnt_create(),
clnt_tli_create()
,orclnt_dg_create() (see rpc_clnt_create(3N)) should be used
instead.
void get_myaddress()
Places the local system’s IP address into *addr , without consulting the library routines that
deal with /etc/hosts. The port number is always set to htons(PMAPPORT)
.
Warning: this routine is only intended for use with the RPC library. It returns the local
system’s address in a form compatible with the RPC library, and should not be taken as the
system’s actual IP address. In fact, the *addr buffer’s host address part is actually zeroed.
This address may have only local significance and should not be assumed to be an address that
can be used to connect to the local system by remote systems or processes.
Warning: this routine remains for backward compatibility only. The routine
netdir_getbyname() (see netdir (3N)) should be used with the name HOST_SELF to
retrieve the local system’s network address as a netbuf structure.
struct pmaplist *pmap_getmaps()
A user interface to the portmap service, which returns a list of the current RPC program-to-
port mappings on the host located at IP address addr. This routine can return NULL. The
command ‘rpcinfo -p’ uses this routine.
Warning: this routine exists for backward compatibility only, enhanced functionality is pro-
vided by
rpcb_getmaps() (see rpcbind (3N)).
u_short pmap_getport()
A user interface to the portmap service, which returns the port number on which waits a ser-
vice that supports program prognum , version versnum , and speaks the transport protocol asso-
ciated with protocol . The value of protocol is most likely IPPROTO_UDP or IPPROTO_TCP.
A return value of 0 means that the mapping does not exist or that the RPC system failed to
contact the remote portmap service. In the latter case, the global variable rpc_createerr
contains the RPC status.
4 Hewlett-Packard Company − 4 − HP-UX 11i Version 3: September 2010