garlic_90ef4b6f/Examples/Reconnection/rci_2.adb

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
with Ada.Text_IO;
with System.RPC;
with RCI_3;

package body RCI_2 is

   function F (S : String) return String is
      Failures : Natural := 0;
   begin
      while Failures < 20 loop
         begin
            return "(via RCI_2.F) " & RCI_3.F (S);
         exception when System.RPC.Communication_Error =>
            Ada.Text_IO.Put_Line ("Fail to execute RPC RCI_3.F");
            delay 1.0;
         end;
         Failures := Failures + 1;
      end loop;
      raise Program_Error;
   end F;

end RCI_2;