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

⟦68652f25b⟧ Ada Source

    Length: 11264 (0x2c00)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Behavior, seg_02c2fe

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 Behavior_Defs;
with Identifier;
with Message;
with Message_Transport;
with Method;
with Parameter;
with Signature;
package body Behavior is

    This : Identifier.Object; -- set once the behavior has been identified

    Registered : Boolean := False;


    procedure Register_Service (Host : String;
                                Socket : Message_Transport.Socket) is separate;


    function Identified (M : String) return Boolean is separate;



    procedure Process_Message (M : String) is
    begin
        Process_Message (Message.Value (M));
    end Process_Message;


    procedure Transport_Start is new Message_Transport.Start_Server
                                        (Register_Service => Register_Service,
                                         Service_Identified => Identified,
                                         Ready_To_Receive => Ready_To_Receive,
                                         Receive_Callback => Process_Message);


    task Server is
        entry Start;
        pragma Os_Task (0); --[to get non blocking socket reads]
    end Server;


    task body Server is
    begin
        accept Start;

        Transport_Start (Local_Socket => 0, Buffer_Size => 1024);
        --
        -- when Local_Socket is 0 the transport layer will invent one


    end Server;


    procedure Send_Message (Message : Standard.Message.Object;
                            Status : out Message_Transport.Status_Code) is

        Addressee : Identifier.Object :=
           Identifier.Value (Standard.Message.Get_Addressee (Message));

        use Standard.Message;
    begin

        if not Registered then
            raise Not_Yet_Registered_Error;
        end if;

        if Standard.Message.Get_Class (Message) = Standard.Message.Forward then
            Message_Transport.Put
               (Message => Standard.Message.Image (Message),
                Remote_Host => Identifier.Get_Host (Identifier.Broker),
                Remote_Socket => Identifier.Get_Socket (Identifier.Broker),
                Number_Of_Retry => 10,
                Retry_Delay => 0.1,
                Status => Status);

        else
            Message_Transport.Put
               (Message => Standard.Message.Image (Message),
                Remote_Host => Identifier.Get_Host (Addressee),  
                Remote_Socket => Identifier.Get_Socket (Addressee),
                Number_Of_Retry => 10,
                Retry_Delay => 0.1,
                Status => Status);

        end if;
    end Send_Message;


    function Get_Identity return Identifier.Object is
    begin  
        if not Registered then
            raise Not_Yet_Registered_Error;
        end if;

        return This;
    end Get_Identity;


begin
    Server.Start;
end Behavior;

E3 Meta Data

    nblk1=a
    nid=5
    hdr6=6
        [0x00] rec0=22 rec1=00 rec2=01 rec3=082
        [0x01] rec0=25 rec1=00 rec2=02 rec3=020
        [0x02] rec0=20 rec1=00 rec2=04 rec3=000
        [0x03] rec0=21 rec1=00 rec2=04 rec3=01a
        [0x04] rec0=02 rec1=00 rec2=05 rec3=000
        [0x05] rec0=12 rec1=00 rec2=0a rec3=000
        [0x06] rec0=14 rec1=00 rec2=07 rec3=000
        [0x07] rec0=14 rec1=00 rec2=07 rec3=000
        [0x08] rec0=14 rec1=00 rec2=07 rec3=000
        [0x09] rec0=14 rec1=00 rec2=07 rec3=001
    tail 0x21524611483f84aaba59a 0x42a00088462060003
Free Block Chain:
  0x5: 0000  00 0a 00 03 00 00 00 22 42 65 68 61 76 69 6f 72  ┆       "Behavior┆
  0xa: 0000  00 09 00 13 80 10 67 65 5f 54 72 61 6e 73 70 6f  ┆      ge_Transpo┆
  0x9: 0000  00 07 03 fc 80 0c 74 68 6f 64 2e 4f 62 6a 65 63  ┆      thod.Objec┆
  0x7: 0000  00 03 01 fa 80 0c 53 6f 63 6b 65 74 20 28 49 64  ┆      Socket (Id┆
  0x3: 0000  00 06 03 5c 80 4f 20 20 20 20 20 20 2d 2d 20 20  ┆   \ O      --  ┆
  0x6: 0000  00 08 03 fc 80 39 6f 6e 32 20 28 48 6f 73 74 20  ┆     9on2 (Host ┆
  0x8: 0000  00 00 03 fc 80 38 20 20 20 20 20 20 20 41 64 64  ┆     8       Add┆