DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦98bc7a555⟧ Ada Source

    Length: 5120 (0x1400)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, procedure Reception, seg_054766

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code



with Text_Io;
with Transport;
with Transport_Defs;
with Byte_Defs;
with Utils;
with Trame;
with Bounded_String;

procedure Reception is
    Chaine : String (1 .. 1024);
    Compteur : Natural;
    Mot_Cle1 : constant String (1 .. 255) := "date" & (5 .. 255 => Ascii.Nul);
    Mot_Cle2 : constant String (1 .. 255) := "heure" & (6 .. 255 => Ascii.Nul);
    Mot_Cle3 : constant String (1 .. 255) := "jour" & (5 .. 255 => Ascii.Nul);

    Connection : Transport.Connection_Id;
    Status : Transport_Defs.Status_Code;
    Network : constant Transport_Defs.Network_Name := "TCP/IP";
    Local_Socket : Transport_Defs.Socket_Id (1 .. 4);

    Data : Byte_Defs.Byte_String (1 .. 1024);
    Count : Natural;
    Max_Wait : Duration := 6000.0;    --Duree d'attente max.: 6000 secondes
    More_Data : Boolean := False;

begin
    Local_Socket := Trame.Donne_Socket (Trame.Fait_Host_Socket (2, 6, 0, 6));
    Transport.Open (Connection, Status, Network, Local_Socket);
    if Transport.Is_Open (Connection) then
        Text_Io.New_Line;
        Text_Io.Put_Line ("OK: La connection est ouverte...");
    else
        Text_Io.New_Line;
        Text_Io.Put_Line ("ERREUR: La connection n'est pas ouverte...");
    end if;

    Text_Io.Put_Line ("Je tente de me connecter...");
    Transport.Connect (Connection, Status, Max_Wait);
    if Transport.Is_Connected (Connection) then
        Text_Io.Put_Line ("OK: On est connecte...");
    else
        Text_Io.Put_Line ("ERREUR: On n'est pas connecte..");
    end if;

    Text_Io.Put_Line ("Je tente de recevoir...");
    Transport.Receive (Connection, Status, Data, Count, Max_Wait);
    Text_Io.Put ("J'ai recu ");
    Text_Io.Put (Integer'Image (Count));
    Text_Io.Put_Line (" octets:  ");
    Text_Io.Put ("Message:  ");

    Chaine := Utils.Byte_String_To_String (Data);
    for Compteur in 1 .. 100 loop --Count loop
        --exit when (Chaine (Compteur) = Ascii.Nul);
        Text_Io.Put (Chaine (Compteur));
    end loop;
    Text_Io.New_Line;
    Text_Io.Put ("Index:  ");
    Text_Io.Put_Line (Integer'Image (Trame.Donne_Integer (Data, 1)));

    Text_Io.Put ("Host:  ");
    Text_Io.Put_Line
       (Bounded_String.Image
           (Trame.Fait_Host
               (Trame.Donne_Host (Trame.Donne_Bounded_String (Data, 2)))));
    Text_Io.Put ("Socket:  ");
    Text_Io.Put_Line (Bounded_String.Image
                         (Trame.Fait_Socket
                             (Trame.Donne_Socket
                                 (Trame.Donne_Bounded_String (Data, 3)))));

    Text_Io.Put ("Codage:  ");
    Text_Io.Put_Line (Integer'Image (Trame.Donne_Integer (Data, 4)));

    Text_Io.Put ("Commande:  ");
    Text_Io.Put_Line (Trame.Convert_String (Trame.Donne_String (Data, 5)));
    Text_Io.Put_Line (Bounded_String.Image
                         (Trame.Donne_Bounded_String (Data, 5)));

    --if (Chaine = Mot_Cle1) then
    --    Text_Io.Put ("Mot Cle DATE!!!");
    --elsif (Chaine = Mot_Cle2) then
    --    Text_Io.Put ("Mot Cle HEURE!!!");
    --elsif (Chaine = Mot_Cle3) then
    --    Text_Io.Put ("Mot Cle JOUR!!!");
    --else
    --    Text_Io.Put ("Mot Cle inconnu!!!");
    --end if;
    Text_Io.New_Line;
    Transport.Disconnect (Connection);
    if Transport.Is_Connected (Connection) then
        Text_Io.Put_Line ("ERREUR: On est encore connecte...");
    else
        Text_Io.Put_Line ("OK: On n'est plus connecte..");
    end if;

    Transport.Close (Connection);
    if Transport.Is_Open (Connection) then
        Text_Io.Put_Line ("ERREUR: La connection n'est pas fermee...");
    else
        Text_Io.Put_Line ("OK: La connection est maintenant fermee...");
    end if;

end Reception;

E3 Meta Data

    nblk1=4
    nid=0
    hdr6=8
        [0x00] rec0=1d rec1=00 rec2=01 rec3=07e
        [0x01] rec0=1b rec1=00 rec2=02 rec3=012
        [0x02] rec0=1a rec1=00 rec2=03 rec3=01c
        [0x03] rec0=18 rec1=00 rec2=04 rec3=000
    tail 0x2175d8b5287b8856e89b5 0x42a00088462060003