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

⟦a9218e512⟧ Ada Source

    Length: 8192 (0x2000)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, procedure Task_Orb, seg_055f7f

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 Transport_Name;
with Byte_Defs;
with Utils;
with String_Utilities;
with Bounded_String;
with Trame;

procedure Task_Orb is
    Chaine : String (1 .. 1024);
    Connection : Transport.Connection_Id;
    Status : Transport_Defs.Status_Code;
    Network : constant Transport_Defs.Network_Name := "TCP/IP";
    Local_Socket : Transport_Defs.Socket_Id (1 .. 2);
    Host_Ficus : Transport_Defs.Host_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_Socket_String (10, 46));--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 vers l Objet est ouverte...");
    else
        Text_Io.New_Line;
        Text_Io.Put_Line
           ("ERREUR: La connection vers l Objet n'est pas ouverte...");
    end if;

    Text_Io.Put_Line ("Je tente de me connecter a l Objet...");
    Transport.Connect (Connection, Status, Max_Wait);
    if Transport.Is_Connected (Connection) then
        Text_Io.Put_Line ("OK: On est connecte a l Objet...");
    else
        Text_Io.Put_Line ("ERREUR: On n'est pas connecte a l Objet ...");
    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.Extrait (Data, 2)))));
    Text_Io.Put ("Socket:  ");
    Text_Io.Put_Line (Bounded_String.Image
                         (Trame.Fait_Socket (Trame.Donne_Socket
                                                (Trame.Extrait (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.Extrait (Data, 5)));
    Text_Io.New_Line;

    Transport.Disconnect (Connection);
    if Transport.Is_Connected (Connection) then
        Text_Io.Put_Line ("ERREUR: On est encore connecte a l Objet...");
    else
        Text_Io.Put_Line ("OK: On n'est plus connecte a l Objet..");
    end if;
    Transport.Close (Connection);
    if Transport.Is_Open (Connection) then
        Text_Io.Put_Line
           ("ERREUR: La connection a l Objet n'est pas fermee...");
    else
        Text_Io.Put_Line
           ("OK: La connection a l Objet est maintenant fermee...");
    end if;




    Transport.Open (Connection, Status, Network);
    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...");
    while not Transport.Is_Connected (Connection) loop
        Transport.Connect
           (Connection, Status, Trame.Donne_Host (Trame.Extrait (Data, 2)),
            Trame.Donne_Socket (Trame.Extrait (Data, 3)), Max_Wait);
    end loop;

    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 transmettre le message...");
    Transport.Transmit
       (Connection, Status,
        Trame.Fait_Trame (69, Trame.Fait_Host (Host_Ficus),
                          Trame.Fait_Socket (Local_Socket), 12345,
                          Bounded_String.Value
                             ("C est la reponse" & Ascii.Nul)), Count,
        Max_Wait, More_Data);

    Text_Io.Put (Integer'Image (Count));
    Text_Io.Put_Line ("  caracteres ont ete envoyes.");

    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 Task_Orb;

E3 Meta Data

    nblk1=7
    nid=5
    hdr6=c
        [0x00] rec0=1f rec1=00 rec2=01 rec3=078
        [0x01] rec0=1b rec1=00 rec2=02 rec3=018
        [0x02] rec0=17 rec1=00 rec2=03 rec3=056
        [0x03] rec0=1d rec1=00 rec2=04 rec3=046
        [0x04] rec0=1c rec1=00 rec2=06 rec3=00c
        [0x05] rec0=08 rec1=00 rec2=07 rec3=000
        [0x06] rec0=68 rec1=5c rec2=00 rec3=000
    tail 0x2176181ca87c341f31bc5 0x42a00088462060003
Free Block Chain:
  0x5: 0000  00 00 02 02 80 1d 70 6f 72 74 2e 44 69 73 63 6f  ┆      port.Disco┆