|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 4096 (0x1000) Types: Ada Source Notes: 03_class, FILE, R1k_Segment, e3_tag, procedure Receive, seg_002fe5
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000 └─⟦5a81ac88f⟧ »Space Info Vol 1« └─⟦this⟧
with Byte_Defs; with Byte_String_Io; with Log; with Profile; with Transport; with Transport_Defs; -- procedure Receive (Packets : Positive := 1; Pause : Duration := 0.0; Data : Byte_Defs.Byte_String := (1, 2, 3, 4, 5, 6, 7, 8); Network : Transport_Defs.Network_Name := "UDP/IP"; Socket : Transport_Defs.Socket_Id := (0, 9); Max_Wait : Duration := Duration'Last; Check_Data : Boolean := True) is Connection : Transport.Connection_Id; Status : Transport_Defs.Status_Code; Rcvd_Packets : Natural := 0; Rcvd : Byte_Defs.Byte_String (1 .. Data'Length); Count : Natural; Failed : exception; function "=" (Left, Right : Byte_Defs.Byte_String) return Boolean renames Byte_Defs."="; procedure Check (Status : Transport_Defs.Status_Code; From : String) is function "=" (Left, Right : Transport_Defs.Status_Code) return Boolean renames Transport_Defs."="; begin if Status /= Transport_Defs.Ok then Log.Put_Line ("Transport." & From & ".Status = " & Transport_Defs.Image (Status), Profile.Error_Msg); raise Failed; end if; end Check; begin Log.Put_Line ("Receive" & Natural'Image (Packets), Profile.Auxiliary_Msg); Transport.Open (Connection, Status, Network, Socket); Check (Status, "Open"); Transport.Connect (Connection, Status); Check (Status, "Connect(passive)"); delay Pause; while Rcvd_Packets < Packets loop Transport.Receive (Connection, Status, Rcvd, Count, Max_Wait); Check (Status, "Receive"); if (not Check_Data) or else Rcvd (1 .. Count) = Data then Rcvd_Packets := Rcvd_Packets + 1; delay Pause; else Log.Put_Line ("received " & Byte_String_Io.Image (Rcvd (1 .. Count)) & " from " & Byte_String_Io.Image (Byte_Defs.Byte_String (Transport.Remote_Host (Connection))) & " after" & Natural'Image (Rcvd_Packets) & " packets", Profile.Warning_Msg); end if; end loop; Transport.Close (Connection); Log.Put_Line ("Received" & Natural'Image (Rcvd_Packets) & " packets.", Profile.Positive_Msg); exception when Failed => Transport.Close (Connection); Log.Put_Line ("Receive failed", Profile.Negative_Msg); Log.Put_Line ("Received" & Natural'Image (Rcvd_Packets) & " packets.", Profile.Exception_Msg); end Receive;
nblk1=3 nid=0 hdr6=6 [0x00] rec0=19 rec1=00 rec2=01 rec3=088 [0x01] rec0=18 rec1=00 rec2=02 rec3=07a [0x02] rec0=12 rec1=00 rec2=03 rec3=000 tail 0x20f001412000806be6377 0x42a00088462060003