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

⟦c5d6666f6⟧ TextFile

    Length: 1828 (0x724)
    Types: TextFile
    Names: »B«

Derivation

└─⟦bad92a95e⟧ Bits:30000535 8mm tape, Rational 1000, RPC 1_0_2
    └─ ⟦bb34fe6e2⟧ »DATA« 
        └─⟦15d8b76c6⟧ 
            └─⟦this⟧ 

TextFile

procedure Transport_Server_Proc (Service : in out Service_Type;
                                 Connection : in out Transport.Connection_Id;
                                 Network : Transport_Defs.Network_Name;
                                 Local_Socket : Transport_Defs.Socket_Id) is

    Status : Transport_Defs.Status_Code;
    Fatal_Error : exception;

    Min_Backoff : constant Duration := 0.1;
    Max_Backoff : constant Duration := 5 * 60.0;
    Backoff : Duration := Min_Backoff;

    procedure Do_Backoff (Backoff : in out Duration) is
    begin
        delay Backoff;
        Backoff := 2 * Backoff;
        if Backoff > Max_Backoff then
            Backoff := Max_Backoff;
        end if;
    end Do_Backoff;

    function Status_Ok return Boolean is
    begin
        case Status is
            when Transport_Defs.Ok =>
                return True;
            when Transport_Defs.Too_Many_Clients |
                 Transport_Defs.No_Hardware | Transport_Defs.No_Such_Network |
                 Transport_Defs.Socket_In_Use | Transport_Defs.Access_Denied =>
                raise Fatal_Error;
            when others =>
                Do_Backoff (Backoff);
                return False;
        end case;
    end Status_Ok;

begin
    loop
        Transport.Open (Connection, Status, Network, Local_Socket);
        if Status_Ok then
            Transport.Connect (Connection, Status);
            if Status_Ok then
                Serve (Service, Connection);
                Backoff := Min_Backoff;
            end if;
            Transport.Disconnect (Connection);
        end if;
        Transport.Close (Connection);
    end loop;
exception
    when Fatal_Error =>
        Transport.Close (Connection);
    when others =>
        Transport.Close (Connection);
        raise;
end Transport_Server_Proc;