Using the registerrpc Routine
Only the User Datagram Protocol (UDP) transport mechanism can use the registerrpc routine.
This routine is always safe in conjunction with calls generated by the callrpc routine. The UDP transport mechanism can deal only with arguments and results that are less than 8KB in length.
The RPC registerrpc routine includes the following parameters:
- Program number
- Version number
- Procedure number to be called
- Procedure name
- XDR (eXternal Data Representation) subroutine that decodes the procedure parameters
- XDR subroutine that encodes the procedure calls
After registering the local procedure, the server program's main procedure calls the svc_run routine, which is the RPC library's remote procedure dispatcher. The svc_run routine then calls the remote procedure in response to RPC messages. The dispatcher uses the XDR data filters that are specified when the remote procedure is registered to handle decoding procedure arguments and encoding results.