TheEVALServer--APUPNetworkInter-CommunicationsFacilityforInterlisp-DFile:EvalServer.pressRevised:Feb21,1983andFeb17,1984,byJonLWhiteThefileEVALSERVER.DCOMcontainsroutinestofacilitatecommunication,overtheEtherNet,betweentwoormoreD-machinesrunningInterlisp-D.Insimpleusage,oneormoreD-machines(Dolphin,Dorado,orDandelion)arestartedupwith"servers"running,anda"client"oftheservicemerelyrequests(viatheethernet)thataserverEVALuatesomeform,andreturntheresults.Ausermaydirecthis"remote"evaluationrequesttoaspecificserver,ormaybroadcastitonhisdirectly-connectednetwork;inthelattercase,atmostoneoftheserverswillbegiventhego-aheadtoperformtheservice,butpossiblyinthefuturetherewillbeanextensiontopermitresultsfrommanydiverseserversofabroadcastrequest.(Likelyarequestforservicewillbecoupledwithafunctiontobeappliedtoanyresultsthatcomeback).Startingupthe"server"sideThefunctioncall(EVALSERVER)willinitiateabackgroundprocessnamed"EvalServer.Listening"Allargumentsareoptional,andhavethefollowingmeaning:--ifnon-null,willruntheserviceforonlythenumberofminutesspecified;otherwiseitwillrunindefinitely.--alistofetherhostnames(ornumbers)whomtheserveriswillingtoservice:ifTisonthislist,itwillserviceanyrequestaddressedtothisspecifichost(called,"flirtatious"mode),ifNILisonthelist,itwillserviceanyrequestbroadcastontheconnectednetwork(called,"promiscuous"mode).Defaultforthislist,NIL,isconvertedintotheunionof"flirtatious"and"promiscuous"modes.--alistofhostsforwhomservicewillnotbeperformed;NILonthislistmeansnoserviceforbroadcastrequests;Tonthislistmeansnoservicefor"myself"(i.e.attemptsbysomeprocessrunningconcurrentlyontheserverhosttosenda"remote"evaluationrequesttothesamehost,willberejected).Inanycase,theglobalvariablesEvalServerClientHostsandEvalServerGaggedHostswillbedynamicallyconsultedforthesameinformation;thisissothatyoumaytailortheclientscreeningprocesswhiletheserverisrunning.The"gags"alwayshaveprecedenceoverthe"hosts"lists.Whiletheserverisrunning,acallto(EVALSERVER.ABORT)willstopacurrentlyrunningprocess,suchasonethatisinaloop,orthatis"poaching"moretimeofftheserverthanisdesireable;seebelowunderEVALSERVER.STATUSforadefinitionoftheidentificationterms.maybeeitheraninteger,the"identification"numberofsomeservice,oraconsoftheidnumberandthehost;the"cons"formmayberequirediftherearetwoormoreservices,fromseparaterequestinghosts,withco-incidentallythesameidnumber.permitsrecordingwhyaservicewasstopped;itisoptional,andthedefaultrecordingis"AbortedLocallybyError/Quit".isoptional,andifnon-NIL,willcauseanERRORtooccurifthereisnotransactionasspecifiedbyorofthetransactionseemstobewedged.p c/ b6q b6 `Nb&8L?Bf` _ wN%X/b9lC !"v +_ ^. ^. \+\ [~:#%&).1l59[~ Z& Z& XDw$,v46 >X Wv '.8148L @Wv V l%+/15 >3V TX %)./2k6>3T Sn!$+,2k9>-@Sn RX9&*/3B9#<C=R P wC% /58L9@P Of/"v$(W8L?AOf NN/9#M%)./46;>3N L&*147u=VAL K^%/$+/4:ADDK^ J l$$%,/6:=VDDJ H%bl$$&*049#???H GV GV E E D wN%X/b9"v$(W/3HD CN CN ANA @ wN b(W 3BC=@ ?F%b !(W-a.8@?F =N"v%*-a5<= < l #M+/3B6=V?< ;> wNC$ .869#=V?;> 9 wN ?9 8 9l!$$).-a2k5=V@8 76 wN #M*+.8/2k49#>-?76 5 wN9#M+.82k9=\5 4 wN !'*-a/2k5:=V@4 3. wNb'*-a5<C=3. 1 wN  !(W+/49#;C=1 0~ wNl )., 8L=\0~ /&  $',/4:?A/& - wN l$$(W-a/69A- ,v wNb#M(W*14<@,v + wNb#M* 47u:?+ ) wN9"v +2k48L<@) (n wN r(n ' w9'9<' %l!$$ .869=V@% $f #M&*/3B9#@$f #"v**.849=\# ! /b"v'! ^ ^   X9#M$).* V  ' 3B <V %Xl$$+/2k59<?? 9 "v&*.817u;=\ N bl"v146 ? N  w l"|  bC$$&.81?  F wN/"v$&*-a03B9#<? F  wNX $$&.8059#<?Bf  wN"v +15Bf > wNbI>  b'*,3B6>-@Bf wNl$$,/6=V? 6 wN 9? 6 b $$&.82k7u9?@ wNXl *,47u Bf . wNX %(W*0. q?[]Whiletheserverisrunning,acall(EVALSERVER.STATUS)willreturnalistofinformationassociatedwiththestateofcurrently-runningservices,already-completedservices,andrequestsstillintheinputqueue.A"service"isidentifiedbyaconsofatransactionnumberandahostnumber;thetransactionnumberisinfactthepacketidinthePUPusedtocommunicateovertheEtherNet(asimilarideawilleventuallybeusedwhentheserverisimplementedinNSprotocols).--selectsoneormoreoftheinformationliststobeoutput,asfollows:DONE(orCOMPLETEDorFINISHED)addsintheremnantsofthelistofcompletedservices(whichlistispruneddownfromtimetotimebythe"cleanup"processmentionedabove.Aglobalvariable,\ES.PURGEINTERVAL.SECS,controlsthefrequencyofthe"cleanup"actions,andalsothemaximumtimeforwhicholdcompletedservicerecordsarekept);RUNNING(orCURRENT)addsinthedataforcurrentlyexecutingevaluationsrequests;INPUT(orINPUTQUEUE)addsinthedataforPUP'sstillwaitingforservice.TactsliketheunionofDONEandRUNNING;ALLactslikeaunionofallthreeofDONE,RUNNING,andINPUT;NIL,andnoargument,defaulttosameasALL.--ifnon-null,thenonlyrecordswiththatidentificationnumberwillbeincludedintheresult.Similarly,acall(EVALSERVER.STATUS.WINDOW)willputupawindowwhichcontinuouslymonitorsanddisplaystheaboveinformation.Themiddlemousebuttonisactiveinthisstatuswindowtodeletethevariousitems;deletingaRUNNINGorINPUTrequestisthesameascallingEVALSERVER.ABORTonit.Atracefacilitymaybeenabled/disabledbyafunctioncall:(EVALSERVER.TRACE)where,ifnon-null,enablestraceing;disablesifnull.,ifnon-null,shouldbea"region"andmarksaregionforthetracewindow;ifnull,theuserispromptedto"mouse"aregion.Boththeleftandmidlemousebuttonsare"active"inthetracewindow:LEFTtogglesa"flg"whichturnstraceingonoroff,andMIDDLEdoesaquickclearofthetracewindow.TheClient:UsingaremoteEvalServerThebasicuseofEVALataremotehostisinvokedby:(REMOTEVAL
)TheS-expressionisshippedviatheethernettothehost,whereitisEVALuatedbyanEvalServerandshippedbackIfisNILor0,thentherequestisnotdirectedtoapartricularserver,butismerelybroadcastonthenetwork;ifanyserveriswillingtoservicesucharequest,thenitwill"handshake"withtherequestoranddoso.Iftheremoteevaluationcausesanerror,thenthaterrorwillbe"broughtback"locally,andanerrorwillresultwhichwillincorporatetheremotemessage(ofcourse,thestackandenvironmentoftheremotehostisnot"broughtback").AcurrentlimitationisthatthePRIN4formof,andthatoftheresult,mustfitwithinonePUP--about530bytes. c8 b6q b6 ` ` _X9#M$(]_ ^. +/^. \%l ' 048L=V? \ [~"v19<[~ Z&l"v(W).*3B5 ?ABfZ& X%X l#M&(W,3B47u @X WvXlC$$&).,/46 ?Wv V%#M'+ 47u;<@C=V TX l"v +T Sn w%).+/2k5 ? Sn R wN%b!$$++R P wN%b #M+/2k5=V?BfP Of wN%9!)./3B5;?C=Of N wN%9l#M+2k:@AB`C=N L wN%b 4<? L K^ wN%l ).048L;AK^ J wN%"v*18L;AAJ H wN%"v&).,04<DH GV wN% $%GV E wN%9 #M'*-a149?DE D wN%lC D CN wN%X$$&*.855CN A wN%/bC#M%)..805=V?A @ wN%b9?@ ?F wN%b#M$$*-a147{?F = w/$$(W/3B6= < wN% C$$(W*2k48L?? < ;> /?;> 9 "v19 8%! ,47u>38 76NX C#M)..846<?Bf76 59"v).//7u9#?A5 49 #M*8L:=\4 3. 3. 1 1 0~ 9-a/19#=\0~ /&  (]/& -+- ,v l$$,46:,v + %(W*149;@+ ) wN #M(W+/2k9<Bf) (n wN(n '%$+/69#<@' %C#M(W-a47u9>-@% $f!$$',2q$f # # ! ! ^ ^    wN%X/ %'-a16 V V   NX9l!'+.847{ N  &9)N N 9!(W+/47u9=V@  C ).+.8 7u:@ F% l#M%(W,/69#<C=F  w% 9#M%+469AC= N/l&*,48L:>3 > 9$(W*.8/14: C=> X9l!&*-a49@ N$). 3B6<Bf 6Nbl *-a06:=V? 6 9"v +.82k5:?AHAHG Nb#M&,/3B5:>-DDD .. q?[kTheargumentcancurrentlybeonlyeither0or1(NILdefaultsto1);if0,thentheREMOTEVALfunctionwillnotwaitaroundfortheresultfromtheremotehost,butwillreturnassoonastherehasbeenanacknowledgementthattheserviceisbeingperformed;itsvalueinthiscasewillbetheidentifiernumberuseforthattransaction.Thisisespeciallyusefulwheninvokingalengthytaskwhichisdoneprimarilyfor"effect"ratherthanvalue.Alsoitmaybeusefulewhen"broadcasting"someevaluationwhichwilllaterdirectlysendanotebacktotheinitiator;thusthereisnoneedtogothroughtheseveral"handshake"packets,andgeneral"broadcast"time-consumingprotocols.Also,(REMOTEAPPLY)invokesasimilarremoteuseofAPPLY(asopposedtoEVAL)Perhapsonemaywanttoseehowsomeserverisprogressingonitstasks:(REMOTEVAL'(EVALSERVER.STATUS'ALL))willgetthelistdocumentedabove.Ifonedecidestocancelsomerequest,then(REMOTEABORT)providesaconveniententryintotheEVALSERVER.ABORTfunctionattheremotehost.iseitheranidnumber,oracons,asdescribedaboveforEVALSERVER.ABORT;however,ifonlytheidnumberisgiven,itiscons'dwiththelocalhostnumberbeforesendingtotheserver.Ifalengthycomputationisinitiatedonaserverwhichisnotrunningmultipleprocesses,itwouldbeagoodideaforittochecktheinputqueuefromtimetotime,sayby(EVALSERVER.STATUS'INPUT),andexplicitycall(EVALSERVER1)whentherearewaitingrequests;foritmaybethatoneofthesewaitingrequestsisanabortforthecurrentprocess.Considertheexamplebelow,whereeachtimethroughthePROGloop(whichisbeingsentforremoteevaluation)thereisacheckforpossibleinputs,andashortcalltoEVALSERVERfromthatcodeitself,toinsurethatsubsequentcallswillhaveachancetorun.74_(REMOTEVAL'(PROG((CNT0))LP(DISMISS10000)(addCNT1)(AND(EVALSERVER.STATUS(QUOTEINPUT))(EVALSERVER1))(GOLP))'PLAZA0)5575_(REMOTEVAL'(EVALSERVER.STATUS'ALL)'PLAZA)((Completed.Transactions:((ID#.ClientHost:54BuickoSaurus)(HowStop.#Seconds:COMPLETED127)))(CurrentlyRunning.Transactions:((ID#.ClientHost:56BuickoSaurus)(Process:RUNNING))((ID#.ClientHost:55BuickoSaurus)(Process:RUNNING))))77_(REMOTEABORT55'PLAZA)ABORTEDNotethatthetransactionidforthis"lengthy"processwasreturnedbythecalltoREMOTEVAL,sincewerequestednowaitingaroundfortheresult(thirdargof0).ThenwhentheremoteEVALSERVER.STATUSwasdone,boththattransaction,andtheone c8 b6qN(W+46:@Ab6 ` w%Xl #M%*-a5=V@` _Nb$).,2k7u:>3_ ^.X"v&).6:=\^. \/9 "v%*-a159<? \ [~ /l $ /047u ?[~ Z&C$)..804=V?Z& Xb"v#M$$(W*.807u; GpX Wv% bl!&.82k48L<?AWv V /bl"v&).+2k5< EV T & 3B ;T Sn Sn R+R P w bl% 0C=P OfX#M%*.847u;Of N N L L K^b"v%*/2k <?AK^ JJ H &+44H GV% #M).**-a07u9?C=GV EE D  #M //D CN/ l"v&*8L?ACN AN/9 %(W.803B9<>-BfA @ wC-a47u;?@@ ?FX9C$$(W+04:??F =/r= < < ;> w% "v*-a/49<? ;> 99 "v$*,.82k69<?C=9 8NXb #M(W+.8/>38 76C"v ,2k7u:@76 5X9#M&)..84<?@5 4Xl$%&.818L>-Bf4 3.%Xl!%+.83B7u:?3. 1 C#M&.848L9?Bf1 0~ w #M*,2k67u ?0~ /&/b"v%/& - - ,v w 9?,v + wN%+ ) wN%X/$%) (n wN%X/!!(n ' wN%X/+18L8R' % wN%X/b9 %(]% $f wN%X/I$f # wN%# ! wN%^! ^ w+ ^  w }  w 9*/4 V w#M#SV  wN%"v .8.>  wN%X#M+0 N wN).)4N  wN%"v .8.>  wN%X$$$* F wN%"v .8.>F  wN%X %  w } > wl$*>  w^ 6%X !$$'+4:=\ 6 b (W-a/8L:@ /l#M&).,-a159#>3 .l"v&* 59#<? . q?[actuallycausingtheevalserverstatustoberead,showupasID's55and56.Asubsequentremoteabortfornumber55willstopit,andleavearecordthatitwasremotelyaborted.Ofcourse,thisisnotnecessaryiftheEVALSERVERisrunningunderthePROCESSWORLD.SomeImplementationDetails:Thesemi-well-knownsocketnumber668isusedforreceivingevalservicerequests. c8 b6q9 %+.8059<?Bfb6 ` w/ %*.8/47u;?Bf` _NX!$,4458L?Bf_ ^. w9 (W*169)^. \ \ [~ [~ Z& Z& X X Wv wN%X/b9lC !"v#M$$$%&&Wv V wN%X/b9 +2qV T T SnN!'*-a14=V@Sn R?R< q?[$~GACHA ~GACHA :  #=%j/(&'({ERIS}LIBRARY>EVALSERVER.TTY;1JONL.PA25-Jun-84 04:07:56