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

⟦f2c450ccd⟧ Ada Source

    Length: 8192 (0x2000)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Umps_Message, seg_027f7d

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 Behavior_Link_Layer;
with Host_Name;
with Low_Level_Message;
with Mailbox_Msg_To_Send;
with Mailbox_Received_Msg;
with Physical_Layer;
with Protocol;
with Socket_Defs;
with Socket_Port;
with Text_Io;
with Umps_Utilities;


package body Umps_Message is


    -- Create the tasks witch controlled the fifo where are stocked temporary the messages :

    Task_Performing_Mailbox_Received_Msg :
       Mailbox_Received_Msg.Access_Task_Mailbox :=
       new Mailbox_Received_Msg.Task_Mailbox;

    Task_Performing_Mailbox_Msg_To_Send :
       Mailbox_Msg_To_Send.Access_Task_Mailbox :=
       new Mailbox_Msg_To_Send.Task_Mailbox;


    Task_Server : Behavior_Link_Layer.T_Server;
    Task_Client : Behavior_Link_Layer.T_Client;


    procedure Init (The_Socket_Port : out Socket_Port.Object) is

        The_Local_Listen_Socket_Port        : Socket_Port.Object;
        The_Broker_Listen_Socket_Port       : Socket_Port.Object;
        The_Broker_Host_Name                : Host_Name.Object;
        The_Broker_Connection_Socket_Id     : Socket_Defs.Socket_Id;
        The_Msg_Asking_A_Server_Port_Number : Low_Level_Message.Object;
        The_Result                          : Boolean;
        The_Number_Of_Caracteres_Received   : Integer;

        -- for the tests :
        Default_Brocker_Host_Name : constant String := "belladone";

    begin

        -- Read "parameters" file to find the Brocker Listen socket port :
        -- TO CHANGE ....
        The_Broker_Listen_Socket_Port := Socket_Port.Create (9860);

        The_Broker_Host_Name := Host_Name.Create (Default_Brocker_Host_Name);

        -- .... TO CHANGE !!!


        -- Establish a connection with the broker to ask a number :

        Text_Io.Put ("Try to establish a connection with " &
                     The_Broker_Host_Name.The_String & "...");
        The_Broker_Connection_Socket_Id :=
           Physical_Layer.Join_Server (The_Broker_Host_Name,
                                       The_Broker_Listen_Socket_Port);

        Text_Io.Put_Line ("to ask a socket port number.");
        The_Local_Listen_Socket_Port := Protocol.Ask_A_Behavior_Socket_Port
                                           (The_Broker_Connection_Socket_Id);

        Text_Io.Put_Line ("(umps_message) I got my number.");

        Physical_Layer.Close_Socket (The_Broker_Connection_Socket_Id);

        Text_Io.Put_Line ("(umps_message) Connection closed");

        -- I received a socket port for my server so I can start it !

        Task_Server.Start (The_Local_Listen_Socket_Port,
                           Task_Performing_Mailbox_Received_Msg);

        Text_Io.Put_Line ("(umps_message) Task_Server Started");

        Task_Client.Start (The_Broker_Listen_Socket_Port, The_Broker_Host_Name,
                           Task_Performing_Mailbox_Msg_To_Send);

        Text_Io.Put_Line ("(umps_message) Task_Client Started");

        The_Socket_Port := The_Local_Listen_Socket_Port;
    end Init;


    procedure Put (Something : in out String; Result : out Boolean) is
        The_Msg_To_Send : Low_Level_Message.Object;

    begin
        The_Msg_To_Send := Low_Level_Message.Create (Something);
        Task_Performing_Mailbox_Msg_To_Send.Put (The_Msg_To_Send, Result);
    end Put;


    procedure Get (Something                     : in out String;
                   Number_Of_Characters_Received : out    Natural;
                   Result                        : in out Boolean) is
        Received_Msg : Low_Level_Message.Object;
    begin
        Task_Performing_Mailbox_Received_Msg.Get (Received_Msg, Result);  
        if Result = True then
            Something := Umps_Utilities.Normalize
                            (Received_Msg.The_String, Something'Length);
            Number_Of_Characters_Received := Received_Msg.The_Size;
        end if;
    end Get;

end Umps_Message;

E3 Meta Data

    nblk1=7
    nid=2
    hdr6=a
        [0x00] rec0=25 rec1=00 rec2=01 rec3=01e
        [0x01] rec0=19 rec1=00 rec2=05 rec3=054
        [0x02] rec0=17 rec1=00 rec2=07 rec3=078
        [0x03] rec0=1c rec1=00 rec2=06 rec3=00a
        [0x04] rec0=01 rec1=00 rec2=04 rec3=000
        [0x05] rec0=09 rec1=00 rec2=02 rec3=000
        [0x06] rec0=04 rec1=00 rec2=05 rec3=001
    tail 0x21722079883ad81b6c60b 0x42a0008846207f403
Free Block Chain:
  0x2: 0000  00 03 03 fc 00 00 00 00 38 20 20 20 20 20 20 20  ┆        8       ┆
  0x3: 0000  00 00 03 fc 80 2f 5f 48 6f 73 74 5f 4e 61 6d 65  ┆     /_Host_Name┆