ONC+ Developer's Guide

Network Types/Transport Selection

rpcgen takes optional arguments that allow a programmer to specify desired network types or specific network identifiers. (For details of network selection, see Transport Interfaces Programming Guide).

The -s flag creates a server that responds to requests on the specified type of transport. For example, the invocation

rpcgen -s datagram_n prot.x

writes a server to standard output that responds to any of the connectionless transports specified in the NETPATH environment variable (or in /etc/netconfig, if NETPATH is not defined). A command line can contain multiple -s flags and their network types.

Similarly, the -n flag creates a server that responds only to requests from the transport specified by a single network identifier.


Caution - Caution -

Be careful using servers created by rpcgen with the -n flag. Network identifiers are host specific, so the resulting server may not run as expected on other hosts.