DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

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 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ B T

⟦193e74192⟧ TextFile

    Length: 2398 (0x95e)
    Types: TextFile
    Names: »B«

Derivation

└─⟦149519bd4⟧ Bits:30000546 8mm tape, Rational 1000, !projects 93-07-13
    └─ ⟦124ff5788⟧ »DATA« 
        └─⟦this⟧ 
└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
    └─ ⟦129cab021⟧ »DATA« 
        └─⟦this⟧ 
└─⟦f64eaa120⟧ Bits:30000752 8mm tape, Rational 1000, !projects 93 02 16
    └─ ⟦6f12a12be⟧ »DATA« 
        └─⟦this⟧ 
└─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04
    └─ ⟦d65440be7⟧ »DATA« 
        └─⟦this⟧ 

TextFile

separate (Message)
procedure Start_Server (Local_Socket : Socket; Buffer_Size : Positive) is
    C : T.Connection_Id;
    S : T_Defs.Status_Code;
    N : constant T_Defs.Network_Name := "TCP/IP";
    Lsid : constant Transport_Defs.Socket_Id :=
       (Byte_Defs.Byte (Local_Socket / 256),
        Byte_Defs.Byte (Local_Socket mod 256));
    Cnt : Positive;
    procedure Close is
    begin
        T.Close (Connection => C);
    end Close;

begin

    if not Transport.Is_Open (Connection => C) then

        T.Open (Connection => C,
                Status => S,
                Network => N,
                Local_Socket => Lsid);

        if S /= Transport_Defs.Ok then
            Text_Io.Put_Line ("get: *** open failed s => " &
                              Transport_Defs.Image (S));
            Close;
        else
            Text_Io.Put_Line ("get: +++ Server Socket Open");
        end if;

    else
        Text_Io.Put_Line
           ("get: --* Server Socket Already Open, reusing socket");
    end if;

    -- if not Transport.Is_Connected (Connection => C) then
    --
    --     T.Connect (C, S);
    --
    --     if S /= Transport_Defs.Ok then
    --         Text_Io.Put_Line ("get: *** connect failed s => " &
    --                           Transport_Defs.Image (S));
    --         Close;
    --     else
    --         Text_Io.Put_Line ("+++ Server Connected");
    --     end if;
    --
    --
    -- else
    --     Text_Io.Put_Line ("--* Server Socket Already Connected");
    -- end if;
    --
    loop
        declare
            Buffer : Byte_Defs.Byte_String (1 .. Buffer_Size) := (others => 0);
        begin
            T.Connect (C, S);
            T.Receive (Connection => C,
                       Status => S,
                       Data => Buffer,
                       Count => Cnt,
                       Max_Wait => Duration'Last);

            if S /= Transport_Defs.Ok then
                Text_Io.Put_Line ("get: receive failed s => " &
                                  Transport_Defs.Image (S));
                Close;
            end if;  
            T.Disconnect (Connection => C);
            Receive_Callback (Utils.Byte_String_To_String
                                 (Buffer (Buffer'First ..
                                             Buffer'First + Cnt - 1)));
        end;
    end loop;



    T.Close (Connection => C);

end Start_Server;