SunRPCOnUDP.mesa
Copyright Ó 1992 by Xerox Corporation. All rights reserved.
Demers, September 20, 1987 11:59:44 am PDT
For Cedar10.0
Chauser, January 7, 1992 11:15 am PST
DIRECTORY
Arpa USING [Address, nullAddress],
ArpaUDP USING [nullPort, Port],
SunRPC
;
SunRPCOnUDP: CEDAR DEFINITIONS
~ {
Types
Address: TYPE ~ Arpa.Address;
nullAddress: Address ~ Arpa.nullAddress;
Port: TYPE ~ ArpaUDP.Port;
nullPort: Port ~ ArpaUDP.nullPort;
Handle: TYPE ~ SunRPC.Handle;
Conversation: TYPE ~ SunRPC.Conversation;
Server: TYPE ~ SunRPC.Server;
Client Handles
SunRPC
Create: PROC [remoteAddress: Address ¬ nullAddress, remotePort: Port ¬ nullPort]
RETURNS [h: Handle];
Create a client handle, from which RPC calls can be made. h.flavor will be $UDP.
GetRemote: PROC [h: Handle]
RETURNS [remoteAddress: Address, remotePort: Port];
Get the remote address associated with a client handle. Create a client handle, from which RPC calls can be made. Flavor must be $UDP.
SetRemote: PROC [h: Handle, remoteAddress: Address, remotePort: Port]
RETURNS [newH: Handle];
Set the remote address associated with a client handle: applicable to $UDP - flavor handles only
GetReplyAddress: PROC [h: Handle] RETURNS [remoteAddress: Address, remotePort: Port];
Gets the remote address associated with the last return from SunRPC.SendCallAndReceiveReply or SunRPC.ReceiveAnotherReply.
Readers / Writers: Marshalling and Unmarshalling to/from memory
OpenReader: PROC [block: REF TEXT] RETURNS [h: Handle];
A reader handle allows deserializing data from a REF TEXT block. Flavor is $reader
OpenWriter: PROC [maxBytes: CARDINAL] RETURNS [h: Handle];
A writer handle allows serializing data into a REF TEXT block. Flavor is $writer
TextFromWriter: PROC [h: Handle] RETURNS [output: REF TEXT];
Returns the contents written so far on the writer. Flavor must be $writer.
Clients
Server Registration
ServerProc: TYPE ~ SunRPC.ServerProc;
On entry, h is ready to get the arguments with SunRPC.GetXXX[h].
If doReply=FALSE, no reply message will be sent.
The value of replyTimeToLive is the number of seconds the reply message will be kept around by the SunRPCOnUDP package for duplicate handling.
CreateServer: PROC [pgm, version: CARD, serverProc: ServerProc, port: Port ¬ nullPort, concurrency: CARDINAL ¬ 1, clientData: REF ¬ NIL] RETURNS [s: Server];
Register serverProc as server for this program / version.
The concurrency arg is the max number of concurrent calls that will be serviced.
GetServerPort: PROC [s: Server] RETURNS [port: Port];
Determine the port on which server is listening.
}...