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

⟦06fdcb63c⟧ Ada Source

    Length: 12288 (0x3000)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, procedure Objet_Abonne, seg_057480

Derivation

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

E3 Source Code



with Message;
with Orb_Tools;  
with Text_Io;  
with Transport_Defs;
with Transport;
with Identification;
with Byte_Defs;

procedure Objet_Abonne is

    My_Mess : Message.Tmessage;
    My_Content : Orb_Tools.Content_String;
    My_Command : Message.Command_Type;
    My_Id : Identification.Tclient_Id := 0;

    My_Host : Orb_Tools.Host_String;
    My_Socket : Orb_Tools.Socket_String;
    My_Name : Orb_Tools.Content_String;

    Cpt : Natural;

    My_Connection : Transport.Connection_Id;
    My_Status : Transport_Defs.Status_Code;

    To_Transmit : Orb_Tools.Data_String;  
    To_Accept : Orb_Tools.Data_String;

    From_Orb : Byte_Defs.Byte_String (0 .. 255);

    The_Net : constant Transport_Defs.Network_Name := "TCP/IP";

    Order : Character;

    Subs_Ok : Boolean := False;
begin

    -- SEND REGISTRATION

    My_Command := Message.Registration;
    Orb_Tools.Copy (Source => "Abonne", Target => My_Name);
    Orb_Tools.Copy (Source => Transport.Local_Host (The_Net),
                    Target => My_Host);

    Transport.Open (My_Connection, My_Status, The_Net);

    Orb_Tools.Copy (Source => Transport.Local_Socket (My_Connection),
                    Target => My_Socket);

    Orb_Tools.Copy (Source => My_Socket, Target => My_Content);
    Orb_Tools.Append (Target => My_Content, Source => ":");
    Orb_Tools.Append (Target => My_Content, Source => My_Host);
    Orb_Tools.Append (Target => My_Content, Source => ":");
    Orb_Tools.Append (Target => My_Content, Source => My_Name);

    Message.Fill_Content (Mess => My_Mess, Cont => My_Content);
    Message.Fill_Command (Mess => My_Mess, Comm => My_Command);
    Message.Fill_Origin (Mess => My_Mess, Orig => My_Id);
    Message.Fill (Data => To_Transmit, Mess => My_Mess);

    Text_Io.Put_Line ("Abonne : send registrartion to ORB : " &
                      Orb_Tools.Image (To_Transmit));

    while not Transport.Is_Connected (My_Connection) loop

        Transport.Connect (My_Connection, My_Status,
                           (193, 54, 146, 132), (10, 42));
    end loop;

    Text_Io.Put_Line ("Abonne : connected to Orb");

    Transport.Transmit (My_Connection, My_Status,
                        Orb_Tools.Vstring_To_Byte_String (To_Transmit), Cpt);

    Transport.Disconnect (My_Connection);

    Text_Io.Put_Line ("Abonne : data transmited.");

    -- WAITING FOR ID

    Text_Io.Put_Line ("Abonne : wait for ID...");

    while not Transport.Is_Connected (My_Connection) loop

        Transport.Connect (My_Connection, My_Status);

    end loop;

    loop

        Transport.Receive (My_Connection, My_Status, From_Orb, Cpt);
        exit when Transport_Defs.Image (My_Status) = "OK";

    end loop;

    Text_Io.Put ("Abonne : received message from ORB : ");

    Orb_Tools.Copy (Target => To_Accept, Source => From_Orb (0 .. Cpt - 1));
    Message.Unfill (To_Accept, My_Mess);
    Message.Unfill_Content (My_Mess, My_Content);
    My_Id := Identification.Tclient_Id'Value (Orb_Tools.Image (My_Content));

    Text_Io.Put_Line (Orb_Tools.Image (To_Accept));

    Transport.Disconnect (My_Connection);

    -- SEND SUBSCRIPTION
    loop
        if not Subs_Ok then
            My_Command := Message.Subscription;
            Orb_Tools.Copy (Target => My_Content, Source => "Datum");

            Message.Fill_Content (Mess => My_Mess, Cont => My_Content);
            Message.Fill_Command (Mess => My_Mess, Comm => My_Command);
            Message.Fill_Origin (Mess => My_Mess, Orig => My_Id);
            Message.Fill (Data => To_Transmit, Mess => My_Mess);

            Text_Io.Put_Line ("Abonne : send subscription to ORB :" &
                              Orb_Tools.Image (To_Transmit));

            while not Transport.Is_Connected (My_Connection) loop
                Transport.Connect (My_Connection, My_Status,
                                   (193, 54, 146, 132), (10, 42));
            end loop;

            Text_Io.Put_Line ("Abonne : connected to Orb");

            Transport.Transmit
               (My_Connection, My_Status,
                Orb_Tools.Vstring_To_Byte_String (To_Transmit), Cpt);

            Text_Io.Put_Line ("Abonne : Data transmited");

            Transport.Disconnect (My_Connection);

        end if;

        -- WAITING fOR ALL DATUM OR ERROR ON SUBSCRIPTION

        Text_Io.Put_Line ("Abonne : Wait for all datum..");


        while not Transport.Is_Connected (My_Connection) loop

            Transport.Connect (My_Connection, My_Status);

        end loop;

        loop

            Transport.Receive (My_Connection, My_Status, From_Orb, Cpt);
            exit when Transport_Defs.Image (My_Status) = "OK";

        end loop;

        Text_Io.Put ("Abonne : received message from ORB : ");

        Orb_Tools.Copy (Target => To_Accept, Source => From_Orb (0 .. Cpt - 1));
        Message.Unfill (To_Accept, My_Mess);
        Message.Unfill_Content (My_Mess, My_Content);
        Text_Io.Put_Line (Orb_Tools.Image (To_Accept));

        Transport.Disconnect (My_Connection);

        Message.Unfill_Command (My_Mess, My_Command);
        if Message.Command_Type'Image (My_Command) =
           Message.Command_Type'Image (Message.Forward) then
            Subs_Ok := True;
        end if;

        Text_Io.Put ("q : quit , others : continue");
        Text_Io.Get (Order);
        exit when Order = 'q';
    end loop;

    -- SEND AN UNSUBSCRIPTION

    My_Command := Message.Unsubscription;
    Orb_Tools.Copy (Target => My_Content, Source => "Datum");

    Message.Fill_Content (Mess => My_Mess, Cont => My_Content);
    Message.Fill_Command (Mess => My_Mess, Comm => My_Command);
    Message.Fill_Origin (Mess => My_Mess, Orig => My_Id);
    Message.Fill (Data => To_Transmit, Mess => My_Mess);

    Text_Io.Put_Line ("Abonne : send unsubscription to ORB :" &
                      Orb_Tools.Image (To_Transmit));

    while not Transport.Is_Connected (My_Connection) loop
        Transport.Connect (My_Connection, My_Status,
                           (193, 54, 146, 132), (10, 42));
    end loop;

    Text_Io.Put_Line ("Abonne : Connected to Orb");

    Transport.Transmit (My_Connection, My_Status,
                        Orb_Tools.Vstring_To_Byte_String (To_Transmit), Cpt);

    Transport.Disconnect (My_Connection);

    Text_Io.Put_Line ("Abonne : data transmited.");

    -- SEND AN UNREGISTRATION

    My_Command := Message.Unregistration;
    Orb_Tools.Copy (Target => My_Content, Source => "");

    Message.Fill_Content (Mess => My_Mess, Cont => My_Content);
    Message.Fill_Command (Mess => My_Mess, Comm => My_Command);
    Message.Fill_Origin (Mess => My_Mess, Orig => My_Id);
    Message.Fill (Data => To_Transmit, Mess => My_Mess);

    Text_Io.Put_Line ("Abonne : send unregistration to ORB :" &
                      Orb_Tools.Image (To_Transmit));

    while not Transport.Is_Connected (My_Connection) loop
        Transport.Connect (My_Connection, My_Status,
                           (193, 54, 146, 132), (10, 42));
    end loop;

    Text_Io.Put_Line ("Abonne : Connected to Orb");

    Transport.Transmit (My_Connection, My_Status,
                        Orb_Tools.Vstring_To_Byte_String (To_Transmit), Cpt);

    Transport.Disconnect (My_Connection);

    Text_Io.Put_Line ("Abonne : data transmited.");

    Transport.Close (My_Connection);

end Objet_Abonne;

E3 Meta Data

    nblk1=b
    nid=0
    hdr6=16
        [0x00] rec0=2a rec1=00 rec2=01 rec3=012
        [0x01] rec0=00 rec1=00 rec2=09 rec3=044
        [0x02] rec0=18 rec1=00 rec2=07 rec3=008
        [0x03] rec0=22 rec1=00 rec2=03 rec3=01a
        [0x04] rec0=17 rec1=00 rec2=02 rec3=056
        [0x05] rec0=23 rec1=00 rec2=0a rec3=08e
        [0x06] rec0=00 rec1=00 rec2=06 rec3=00c
        [0x07] rec0=1c rec1=00 rec2=0b rec3=03e
        [0x08] rec0=0d rec1=00 rec2=05 rec3=022
        [0x09] rec0=1b rec1=00 rec2=04 rec3=02e
        [0x0a] rec0=07 rec1=00 rec2=08 rec3=000
    tail 0x2154e027887c77d48c154 0x42a00088462060003