|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - download
Length: 15360 (0x3c00) Types: Ada Source Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Corp_Orb, seg_05738e
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000 └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« └─⟦this⟧
with Scheduler, Tableur, Trame, Byte_Defs, Tab_Util, Operations, Bounded_String, Affichage; use Affichage, Trame, Operations, Bounded_String; package body Corp_Orb is package The_Scheduler is new Scheduler; Buffer_Contrat, Buffer_Commande, Buffer_Abonnement : Tableur.Tache_Tableur; Done : Boolean := False; --************************************************************************************* task Scrute_Tableau is entry Demarre_Orb; end Scrute_Tableau; task body Scrute_Tableau is Index, Index_Courant, Index_Temporaire : Positive; Nom_Contrat, Nom_Demande : Bounded_String.Variable_String (1024); Socket_Client, Socket_Serveur : Bounded_String.Variable_String (255); Trame, Trame_Temporaire : Byte_Defs.Byte_String (1 .. 1024); Taille : Positive; Resultat, Result, Etat : Integer; Erreur : Boolean; Ok : Boolean; begin --Pl ("Scrute"); The_Scheduler.Donne_Taille_Buffer_Reception (Taille); The_Scheduler.Definir_Communication_Pour_Orb; --Pl ("Com. ORB definie"); The_Scheduler.Accepte_Reception; --Pl ("Reception ORB ok"); select accept Demarre_Orb; loop -- Scrutation du tableau de reception for Index_Courant in 1 .. Taille loop The_Scheduler.Donne_Champ_Type_Integer (Index_Courant, 4, Result); if Result = 0 then The_Scheduler.Donne_Champ_Type_Integer (Index_Courant, 1, Resultat); The_Scheduler.Fabrique_Trame (Index_Courant, Trame); case Resultat is when 1 => -- Service Pl ("!!! REQUETE !!!"); Buffer_Contrat.Trouve (Index, Trame, 5, Erreur); if not Erreur then Buffer_Contrat.Fait_Trame (Index, Trame_Temporaire); The_Scheduler.Init_Socket_Emetteur (Donne_Socket (Extrait (Trame_Temporaire, 3))); The_Scheduler.Envoi_Trame (Trame); --Text_Io.Put_Line ("Demande Envoyee "); else Pl ("Je ne peux satisfaire votre demande ...."); Pl ("Je ne connais pas ce contrat : "); Pl (Bounded_String.Image (Extrait (Trame, 5))); end if; -- Remise a jour du tableau de reception -- (Que le contrat soit trouve ou pas...) The_Scheduler.Efface_Par_Index (Index_Courant); when 2 => -- Reponse Pl ("!!! PROPAGATION !!!"); The_Scheduler.Init_Socket_Emetteur (Donne_Socket (Extrait (Trame, 3))); The_Scheduler.Envoi_Trame (Trame); The_Scheduler.Efface_Par_Index (Index_Courant); when 3 => -- Registration Pl ("!!! REGISTRATION !!!"); -- Memorisation du nom de la demande et de la socket client Copy (Nom_Demande, Extrait_Nom_Contrat (Trame)); Copy (Socket_Client, Extrait (Trame, 3)); Ok := True; -- Lecture du tableau des contrats for Index_Temporaire in 1 .. Taille loop Buffer_Commande.Donne_Integer (Index_Temporaire, 4, Etat); --y a t'il quelquechose de coherent a cet index? si oui, alors if Etat = 0 then Buffer_Commande.Donne_Contrat (Index_Temporaire, Nom_Contrat); -- Si meme nom de contrat if Egal (Nom_Demande, Nom_Contrat) then Buffer_Commande.Donne_String (Index_Temporaire, 3, Socket_Serveur); --Pl ("Ok pour 3"); -- Si meme socket if Egal (Socket_Client, Socket_Serveur) then Ok := False; exit when not Ok; end if; end if; end if; end loop; --Pl ("Ok pour 4"); -- Si l'identifiant NOM+SOCKET n'existe pas => ajout du contrat if Ok then Buffer_Contrat.Ajoute (Trame, Ok); end if; The_Scheduler.Efface_Par_Index (Index_Courant); when 4 => -- Deregistration Pl ("!!! DEREGISTRATION !!!"); -- Memorisation du nom de la demande et de la socket client Copy (Nom_Demande, Extrait_Nom_Contrat (Trame)); Copy (Socket_Client, Extrait (Trame, 3)); Ok := False; -- Lecture du tableau des contrats for Index_Temporaire in 1 .. Taille loop Buffer_Commande.Donne_Contrat (Index_Temporaire, Nom_Contrat); -- Si meme nom de contrat if Egal (Nom_Demande, Nom_Contrat) then Buffer_Commande.Donne_String (Index_Temporaire, 3, Socket_Serveur); -- Si meme socket if Egal (Socket_Client, Socket_Serveur) then Ok := True; Buffer_Contrat.Efface (Index_Temporaire, Erreur); exit when not Ok; end if; end if; end loop; The_Scheduler.Efface_Par_Index (Index_Courant); when others => Done := False; end case; end if; end loop; exit when Done; end loop; end select; end Scrute_Tableau; task Arret_Orb is entry Dispose; end Arret_Orb; task body Arret_Orb is begin loop select accept Dispose do Done := True; end Dispose; end select; exit when Done; end loop; end Arret_Orb; procedure Create_Orb is begin Scrute_Tableau.Demarre_Orb; end Create_Orb; procedure Kill_Orb is begin Arret_Orb.Dispose; end Kill_Orb; end Corp_Orb;
nblk1=e nid=2 hdr6=18 [0x00] rec0=1b rec1=00 rec2=01 rec3=02c [0x01] rec0=16 rec1=00 rec2=0e rec3=090 [0x02] rec0=02 rec1=00 rec2=0b rec3=00a [0x03] rec0=0f rec1=00 rec2=05 rec3=04c [0x04] rec0=00 rec1=00 rec2=06 rec3=012 [0x05] rec0=11 rec1=00 rec2=0d rec3=004 [0x06] rec0=0e rec1=00 rec2=09 rec3=00e [0x07] rec0=12 rec1=00 rec2=0a rec3=0b6 [0x08] rec0=01 rec1=00 rec2=03 rec3=068 [0x09] rec0=0f rec1=00 rec2=08 rec3=044 [0x0a] rec0=1e rec1=00 rec2=07 rec3=00a [0x0b] rec0=13 rec1=00 rec2=04 rec3=000 [0x0c] rec0=23 rec1=00 rec2=04 rec3=001 [0x0d] rec0=40 rec1=00 rec2=00 rec3=002 tail 0x217641b7087c73f4a77ca 0x42a00088462060003 Free Block Chain: 0x2: 0000 00 0c 00 46 80 06 75 72 29 3b 20 20 06 00 32 20 ┆ F ur); 2 ┆ 0xc: 0000 00 00 03 fc 80 1e 20 20 20 20 20 20 20 20 20 77 ┆ w┆