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

⟦e17e64505⟧ Ada Source

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

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 Transport;
with Transport_Defs;
with Text_Io;  
with Io;
with Byte_Defs;
with System;

procedure Serveur is
    Connection : Transport.Connection_Id;
    Status : Transport_Defs.Status_Code;
    Network : constant Transport_Defs.Network_Name := "TCP/IP";
    Socket : constant Transport_Defs.Socket_Id := Transport_Defs.Null_Socket_Id;
    Carlu : Character;
    Bs : Byte_Defs.Byte_String (0 .. 1000);
    Count : Natural;

    function Bs_To_String (Bs : Byte_Defs.Byte_String) return String is
        Chaine : String (1 .. Bs'Length);
        Ind : Natural;
    begin  
        Ind := Chaine'First;
        for I in Bs'First .. Bs'Last loop  
            Chaine (Ind) := Character'Val (Bs (I));
            Ind := Ind + 1;
        end loop;  
        return Chaine;  
    end Bs_To_String;

begin

    Transport.Open (Connection => Connection,
                    Status => Status,
                    Network => Network,
                    Local_Socket => Transport_Defs.Null_Socket_Id);

    if Transport_Defs."/=" (Status, Transport_Defs.Ok) then
        Text_Io.Put_Line ("Erreur sur Open : Code > " &
                          Transport_Defs.Image (Status));
        return;
    else
        declare
            Local_Socket : constant Transport_Defs.Socket_Id :=
               Transport.Local_Socket (Connection);
        begin
            Text_Io.New_Line;
            Text_Io.Put ("No de Socket du serveur > ");
            for I in Local_Socket'Range loop
                Text_Io.Put (System.Byte'Image (Local_Socket (I)));
            end loop;  
            Text_Io.New_Line;
        end;
    end if;

    Transport.Connect (Connection, Status, Duration'Last);

    Text_Io.Put_Line ("Status Connect : " & Transport_Defs.Image (Status));

    if Transport.Is_Connected (Connection) then
        Transport.Receive (Connection => Connection,
                           Status => Status,
                           Data => Bs,
                           Count => Count,
                           Max_Wait => Duration'Last);
        Text_Io.Put_Line ("status reception : " &
                          Transport_Defs.Image (Status));
        Text_Io.Put_Line ("count : " & Natural'Image (Count));
    end if;

    declare
        Message : constant String := Bs_To_String
                                        (Bs (Bs'First .. Bs'First + Count - 1));
    begin
        Text_Io.Put_Line ("Message recu : " & Message);
    end;

    Transport.Close (Connection);


end Serveur;

E3 Meta Data

    nblk1=4
    nid=4
    hdr6=6
        [0x00] rec0=23 rec1=00 rec2=01 rec3=022
        [0x01] rec0=1b rec1=00 rec2=03 rec3=008
        [0x02] rec0=14 rec1=00 rec2=02 rec3=000
        [0x03] rec0=18 rec1=00 rec2=03 rec3=000
    tail 0x2154dda0087c572ec85c8 0x42a00088462060003
Free Block Chain:
  0x4: 0000  00 00 02 fe 80 1c 5f 43 6f 6e 6e 65 63 74 65 64  ┆      _Connected┆