Name

txrxCreate, txrxDelete, txrxList, txrxCallDirect, txrxService, txrxBind - user level commands to call or service ONC Remote Procedure Calls

Synopsis

txrxCreate ?protocol? @file
txrxCreate ?protocol? string
txrxDelete protocol
txrxCallDirect protocol channel procedure ?args?
txrxService protocol channel
txrxBind protocol procedure command
txrxTimeout protocol count delay
txrxList


Description

txrxCreate is used to create a new protocol description. Protocol descriptions are described in the txrx manual page. A protocol description stores a bytecoded representation of an RPC protocol and can be used to send or receive binary data through a communication channel. The data is in eXternal Data Representation (XDR) format defined in RFC 1832. The arguments to txrxCallDirect are the protocol name and the text of the protocol, either as the name of a file, preceded by an @ sign, or as a string. If the protocol argument is missing the command will create a default name with format txrxn. The return value from txrxCreate is the protocol string.

txrxDelete deletes a protocol description and frees all internal state associated to a protocol. txrxDelete closes any open channels to remote services that may have been opened by calls to txrxCall. If the protocol description has been used to provide a service it deletes all service information from the portmapper database. This makes it impossible for clients using txrxCall to contact the server.

Note that the same protocol description can be used simultaneously to provide services and to call other remote services.


txrxCallDirect implements the client side of a remote procedure call. The required arguments are the protocol name, the channel representing the communication link to the server and the name of the protocol procedure that should be executed on the server. The format of the procedure argument is specified in the txrx manual page. If procedure takes any arguments they must follow the procedure name. The result returned by txrxCallDirect is a list representing the return value from the remote procedure.

txrxBind is used on the server side to set a Tcl command to invoke when a client RPC is executed. The Tcl command will take as arguments the arguments received from the client and should return a result in the format specified by the protocol definition. The arguments to txrxBind are the protocol name, a Tcl command string and the name of a protocol procedure. The name of the protocol procedure is returned as result in the format "procedure version program". If txrxBind is invoked without arguments it returns a list of the current bindings.

txrxService implements the server side processing of a remote procedure call. txrxService assumes the socket passed as argument is readable. It then reads and interprets the RPC header, reads the arguments from the communication channel and converts them into Tcl lists. The RPC header contains information on what protocol procedure to call. If a binding between the protocol procedure and a Tcl command exists the Tcl command is invoked. The arguments received from the client are appended to the Tcl command. The result of the call is converted to binary format and sent back to the client. In case an error occurs during the processing of an RPC call the appropriate error message is returned to the client.

txrxList returns the names of all protocols available. To obtain more information about a given protocol see the description of txrx.

txrxTimeout customizes the number of retries and the length of the timeout interval for a given protocol description. Timeouts are used by the client to detect a server problem. Eventually, for packet oriented channels, timeouts can be used to retransmit service requests. The parameters to txrxTimeout are the number of retries, count, and the time spent sleeping between retries, delay. Delay is given in miliseconds. The default values are 3 retries each lasting 4 seconds.

Keywords

remote procedure call, channel, external data representation, client-server, communication