Binding in SRPC

In SRPC, as in most other RPC implementations, the client and server must establish a relationship or binding before they can communicate. There are two types of binding data structures: SrpcClntBinding for the client side, and SrpcServBinding for the server side.

Binding and Sockets

SRPC does not contain any facilities for client and server processes to originally learn of each others' existence --- that is left to the user.

To bind a client and server together using SRPC, the client and server must first establish communication via sockets. Once the client and server have sockets that are connected to each other, they both call an SRPC binding procedure, passing in the file-descriptor for the socket. The SRPC binding procedures use the socket to exchange some information; before returning, they close the socket.

The stub generator creates procedures for both client-side and server-side binding. There is a separate set of binding procedures for each RPC interface. For example, the foo service has two binding procedures:

SrpcClntBinding * null_clientBind(int socketFileDesc); srpcServBinding * null_serverBind(int socketFileDesc); Both procedures return a pointer to a binding object, or NULL if there was an error.

Once bindings have been generated, they can be used by the client and server code to communicate.

At present there is no way to destroy a binding.

Ed Felten