[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Communications Programming Concepts

Remote Procedure Call Runtime Library

The Remote Procedure Call (RPC) run-time library, included in the /usr/lib/libnck.a library, contains the routines, tables, and data that support the communication of RPCs between clients and servers.

RPC run-time routines are responsible for transmitting RPC packets between the client and server stubs (program modules that transfer RPCs and responses between a client and a server).


The RPC run-time library contains routines that are normally used only by clients (client routines), some that are normally used only by servers (server routines), and others that both clients and servers can use (conversion routines).

Client Routines

The client and its stub use handles as temporary location identifiers to represent the object and the server to the RPC run-time routines. The object or server is linked with its specific location through a process called binding.

Manual binding occurs when the client makes the RPC library handle management calls directly. Automatic binding occurs when the client stub calls a routine (written by the application developer) that makes all of the client's calls to the RPC run-time routines.

The RPC run-time routines that are called by clients include routines that either create handles or manage their binding state. In addition, one routine sends and receives packets.

Server Routines

The RPC run-time routines that are called by servers initialize the server, except for one routine that identifies the object to which a client has requested access.

Most of the server routines in the RPC run-time library initialize the server so that it can respond to client requests for one or more interfaces. In the server code, routines should be included to do the following:

The RPC run-time library provides two routines that create sockets. One creates a socket with a well-known port while the other creates a socket with an opaque port number.

A single server can support several interfaces. It can also listen on several sockets at a time. Most servers use one socket for each address family. A server is not required to use different sockets for different interfaces.

The server must register each interface that it exports with the RPC run-time library so that the run-time library can direct client calls to the procedures that implement the requested operations. The library also includes a routine to unregister an interface that the server no longer exports.

Once the server creates sockets, registers its interfaces, and begins listening, it is not required to make additional calls to the initialization routines. However, a server can register and unregister interfaces while it is running.

Conversion Routines

The RPC run-time library also provides two routines that convert between names and socket addresses. These routines enable programs to use names rather than addresses to identify server hosts.

[ Previous | Next | Contents | Glossary | Home | Search ]