|
|
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: 8192 (0x2000)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Trans, seg_0538c7
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦cfc2e13cd⟧ »Space Info Vol 2«
└─⟦this⟧
with Text_Io;
with Transport;
with Transport_Defs;
with Byte_Defs;
with Utils;
with Message;
with Bounded_String;
package body Trans is
task Reception;
task Emission;
task body Reception is
The_Mess : Message.Tmessage;
The_Content : Message.Content_String;
The_Command : Message.Command_Type;
The_Receive : Message.Data_String;
Name_Of_Network : constant Transport_Defs.Network_Name := "TCP/IP";
Orb_Socket : constant Transport_Defs.Socket_Id := (2, 6, 0, 2);
Host : constant Transport_Defs.Host_Id :=
Transport.Local_Host (Name_Of_Network);
Connexion1 : Transport.Connection_Id;
Status1 : Transport_Defs.Status_Code;
From_Transmitter : Byte_Defs.Byte_String (0 .. 255);
Cpt : Natural;
Try : Natural := 2;
begin
loop
Transport.Open (Connexion1, Status1, Name_Of_Network, Orb_Socket);
if Transport.Is_Open (Connexion1) then
Text_Io.Put_Line ("Connexion is open for the reveiver.");
else
Text_Io.Put_Line ("Can't open connexion for the receiver.");
Try := Try - 1;
end if;
exit when (Try = 0 or Transport.Is_Open (Connexion1));
end loop;
Text_Io.Put_Line ("Receiver is waiting for a connecxion ...");
while not Transport.Is_Connected (Connexion1) loop
Transport.Connect (Connexion1, Status1);
Text_Io.Put_Line ("Status receiver : " &
Transport_Defs.Image (Status1));
end loop;
Text_Io.Put_Line ("Someone is connected to the receiver.");
loop
Transport.Receive (Connexion1, Status1, From_Transmitter, Cpt);
exit when Transport_Defs.Image (Status1) = "OK";
end loop;
Bounded_String.Copy
(Target => The_Receive,
Source => Utils.Byte_String_To_String (From_Transmitter)
(1 .. Cpt));
Message.Unfill (Data => The_Receive, Mess => The_Mess);
Message.Unfill_Command (Comm => The_Command, Mess => The_Mess);
Message.Unfill_Content (Cont => The_Content, Mess => The_Mess);
Text_Io.Put_Line ("Message : " &
Message.Command_Type'Image (The_Command) & "..." &
Bounded_String.Image (The_Content));
Transport.Close (Connexion1);
end Reception;
task body Emission is
The_Mess : Message.Tmessage;
The_Content : Message.Content_String;
The_Command : Message.Command_Type;
To_Transmit : Message.Data_String;
Name_Of_Network : constant Transport_Defs.Network_Name := "TCP/IP";
Orb_Socket : constant Transport_Defs.Socket_Id := (2, 6, 0, 2);
Connexion1 : Transport.Connection_Id;
Status1 : Transport_Defs.Status_Code;
From_Transmitter : Byte_Defs.Byte_String (0 .. 255);
Cpt : Natural;
Try : Positive := 2;
begin
loop
Transport.Open (Connexion1, Status1, Name_Of_Network);
if Transport.Is_Open (Connexion1) then
Text_Io.Put_Line ("Connecxion is open for the transmitter.");
else
Text_Io.Put_Line ("Can't open connecxion for transmitter");
Try := Try - 1;
end if;
exit when (Try = 0 or Transport.Is_Open (Connexion1));
end loop;
Text_Io.Put_Line ("Try to contact (2602)...");
while not Transport.Is_Connected (Connexion1) loop
Transport.Connect
(Connexion1, Status1,
Transport.Local_Host (Name_Of_Network), Orb_Socket);
Text_Io.Put_Line ("Status emet : " &
Transport_Defs.Image (Status1));
end loop;
Text_Io.Put_Line ("(2602) is connected");
The_Command := Message.Registration;
Bounded_String.Copy (Target => The_Content, Source => "I can do that");
Message.Fill_Content (Mess => The_Mess, Cont => The_Content);
Message.Fill_Command (Mess => The_Mess, Comm => The_Command);
Message.Fill (Data => To_Transmit, Mess => The_Mess);
Transport.Transmit
(Connexion1, Status1,
Utils.String_To_Byte_String (Bounded_String.Image (To_Transmit)),
Cpt);
Transport.Close (Connexion1);
end Emission;
end Trans;
nblk1=7
nid=0
hdr6=e
[0x00] rec0=23 rec1=00 rec2=01 rec3=00a
[0x01] rec0=00 rec1=00 rec2=05 rec3=02e
[0x02] rec0=1c rec1=00 rec2=02 rec3=00c
[0x03] rec0=1a rec1=00 rec2=06 rec3=01c
[0x04] rec0=07 rec1=00 rec2=03 rec3=07c
[0x05] rec0=18 rec1=00 rec2=04 rec3=054
[0x06] rec0=0f rec1=00 rec2=07 rec3=001
tail 0x2175b7bc487ae662f5050 0x42a00088462060003