ComputeServerInternal.mesa
The internal server interface for the Summoner. This interface resides on the server, is internal to the Summoner, and is not an RPC interface.
Last Edited by: Bob Hagmann, August 5, 1986 11:28:19 am PDT
Hal Murray, March 23, 1986 0:27:07 am PST
Copyright © 1984 by Xerox Corporation. All rights reserved.
DIRECTORY
BasicTime,
Commander,
ComputeServer,
ComputeServerClient,
ComputeServerCallbacksRpcControl,
ComputeServerControllerRpcControl,
ComputeServerServer,
ComputeServerStatistics,
InterpreterToolPrivate,
IO,
PrincOps,
Pup USING [Address, nullAddress],
PupStream USING [Sockets],
Rope,
RPC,
RuntimeError,
SymTab;
ComputeServerInternal: CEDAR DEFINITIONS =
BEGIN
ROPE: TYPE = Rope.ROPE;
STREAM: TYPE = IO.STREAM;
IdleTransitionsEnabled: BOOL;
ActiveServices: INT; -- count of currently active services
LastActiveTime: BasicTime.GMT;
myHostName: ROPE;
MyNetAddressRope: ROPE;
ControllerGVName: ROPE;
RemoteCommandDir: ROPE;
LocalCommandDir: ROPE ;
OKToUseLocalDisk: BOOL;
DisableIFIdle: BOOL;
DisableIFIdleAfter: INT;
DisableIFIdleBefore: INT;
RegisteredProcObject: TYPE = ComputeServerServer.RegisteredProcObject;
RegisteredProcObject: TYPE = RECORD [
version: Rope.ROPE,
service: Rope.ROPE,
commanderProcHandle: Commander.CommandProcHandle ← NIL
];
RegisteredProcHandle: TYPE = REF RegisteredProcObject;
PackageEntryObject: TYPE = RECORD [
package: ROPENIL,
dfCreate: BasicTime.GMT ← BasicTime.nullGMT,
commands: LIST OF ROPENIL,
maintainer: LIST OF ROPENIL,
latestVersion: ROPENIL,
runVersion: ROPENIL,
exclusive: BOOLFALSE,
maxCountActive: INT ← 10000,
nowActive: INT ← 0
];
PackageEntry: TYPE = REF PackageEntryObject;
PackageTable: SymTab.Ref;
CmdEntryObject: TYPE = RECORD [
service: ROPENIL,
package: ROPENIL,
version: ROPENIL,
firstTime: BOOLTRUE,
doQueueing: BOOLFALSE,
okToQueuePosted: BOOLFALSE
];
CmdEntry: TYPE = REF CmdEntryObject;
ConfigEntryObject: TYPE = RECORD [
package: ROPENIL,
dfCreate: BasicTime.GMT ← BasicTime.nullGMT,
maintainer: LIST OF ROPENIL
];
ConfigEntry: TYPE = REF ConfigEntryObject;
ConfigTable: PUBLIC SymTab.Ref;
ActiveServicesListBase: ActiveServicesItem ;
ActiveServicesItem: TYPE = REF ActiveServicesItemObject;
ActiveServicesPointer: TYPE = LONG POINTER TO ActiveServicesItemObject;
StreamEOFState: TYPE = {true, pending, false};
ActiveServicesItemObject: TYPE = RECORD [
next: ActiveServicesItem,
callbacksInterface: ComputeServerCallbacksRpcControl.InterfaceRecord ← NIL,
listenerPupAddress: Pup.Address,
startListenGMT: BasicTime.GMT,
sockets: PupStream.Sockets,
heardDoService: BOOLFALSE,
debugItem: BOOLFALSE,
quitRendezvousAttempt: BOOLFALSE,
rendezvousDone: BOOLFALSE,
h: InterpreterToolPrivate.Handle ← NIL,
originalListenerPupAddress: Pup.Address ← Pup.nullAddress,
procHandle: RegisteredProcHandle,
msg: ROPENIL,
success: ComputeServerClient.RemoteSuccess,
remoteStream: IO.STREAMNIL,
clientNetAddressRope: ROPENIL,
clientMachineName: ROPENIL,
userName: ROPENIL,
packageEntry: PackageEntry,
commandEntry: CmdEntry,
inEOF: BOOLFALSE,
outEOF: StreamEOFState ← false,
flushCounter: INT ← -1,
outStreamBusy: BOOLFALSE,
doingEnumerate: BOOLFALSE,
callOver: BOOLFALSE,
pleaseAbort: BOOLFALSE,
request: LIST OF ComputeServer.Request
];
CurrentRequests: LIST OF ComputeServer.Request;
BufStreamData: TYPE = REF BufStreamDataObject;
BufStreamBufferSize: CARDINAL = 1024; -- must be a power of 2 and match BufStreamBufferSizeMask
BufStreamBufferSizeMask: INT = 1777B; -- must match BufStreamBufferSize
bufStreamState: TYPE = {true, pending, false};
BufStreamDataObject: TYPE = RECORD [
inPointer: CARD ← 0,
outPointer: CARD ← 0,
EOF: bufStreamState ← false,
listenerItem: ActiveServicesItem,
buffer: ARRAY [0..BufStreamBufferSize) OF CHARALL[' ],
backUpChars: LIST OF CHARNIL
];
CommandTable: SymTab.Ref; -- knowing a command, find the package/version
MarkGuestProcess: PROC [process: PROCESS, data: LONG POINTER] RETURNS [ok: BOOLTRUE, oldData: LONG POINTER];
Establish this process as a guest. data must point to "guest process data"
IsGuestProcess: PROC [] RETURNS [isGuest: BOOL] ;
GetGuestProcessData: PROC [process: PROCESS] RETURNS [data: LONG POINTER];
MarkProcessNotGuest: PROC [process: PROCESS];
Temporarily flag this process as not a guest, but retain "guest process data". All use of FS, UserCredentials and UserProfile will now be done locally.
RemoveMarkProcessNotGuest: PROC [process: PROCESS];
Reverses the effect of MarkProcessNotGuest
MarkProcessUseLocalFS: PROC [process: PROCESS];
Temporarily flag this process as not a guest for FS calls, but retain "guest process data".
RemoveMarkProcessUseLocalFS: PROC [process: PROCESS];
Reverses the effect of MarkProcessUseLocalFS
AddPupAddress: PROC [serverPupAddress: Pup.Address, procHandle: RegisteredProcHandle, sockets: PupStream.Sockets] RETURNS [newItem: ActiveServicesItem];
Note a new active service
DeletePupAddress: PROC [serverPupAddress: Pup.Address] RETURNS [found: BOOL];
Remove an active service
MatchPupAddress: PROC [serverPupAddress: Pup.Address, flagStarted: BOOLFALSE] RETURNS [found: BOOL, item: ActiveServicesItem];
Find an active service by pup address - that's a unique id.
GetClientInterfaceFromCache: PROC [clientInstance: RPC.ShortROPE, forceNewInterface: BOOLFALSE] RETURNS [clientInterface: ComputeServerCallbacksRpcControl.InterfaceRecord ← NIL];
DeleteClientInterfaceFromCache: PROC [clientInterface: ComputeServerCallbacksRpcControl.InterfaceRecord] RETURNS [gotIt: BOOLFALSE];
findDebuggerItemFromInterpreterHandle: PROC [h: InterpreterToolPrivate.Handle] RETURNS [found: BOOL, item: ActiveServicesItem ← NIL];
KillOldUnstartedServices: PROC;
inStreamProcs: REF IO.StreamProcs;
outStreamProcs: REF IO.StreamProcs;
inCharsAvail: PROC [self: STREAM, wait: BOOL] RETURNS [INT];
inBufGetChar: PROC [self: STREAM] RETURNS [ch: CHAR];
outBufPutChar: PROC [self: STREAM, char: CHAR];
ControllerInterface: ComputeServerControllerRpcControl.InterfaceRecord;
ServiceEnabled: BOOL;
SendStats: PROC [] RETURNS [success, terminateService, newPackage: BOOL, queueingCommands: LIST OF Rope.ROPE];
InitStats: PROC [myName: RPC.ShortROPE, myAddress: RPC.ShortROPE] ;
InitCommands: PROC [remoteCommandDirectory, localCommandDirectory: Rope.ROPE] RETURNS [msg: Rope.ROPENIL] ;
getNewPackages: PROC;
MyCatcher: RuntimeError.UCSProc;
SummonerServerMonitor: PROC;
ReportServerEvent: PROC [type: ComputeServerStatistics.ServerEventType, command: Rope.ROPE, startTime: BasicTime.GMT, endTime: BasicTime.GMT, remoteMachineName: Rope.ROPE, userName: Rope.ROPE];
END.
Bob Hagmann April 18, 1986 10:05:03 am PST
added rendezvous to ActiveServicesItemObject
Bob Hagmann July 11, 1986 8:34:18 am PDT
NAT is only a 16 bit value => change BufStreamDataObject to use CARD
, bufStreamState
Bob Hagmann August 5, 1986 11:37:51 am PDT
added stuff for poweroff if idle