|
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 - download
Length: 6144 (0x1800) Types: Ada Source Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Com_Slave, seg_05579c
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000 └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« └─⟦this⟧
with Transport, Transport_Defs, Text_Io, Utils, Byte_Defs, Host_Id_Io; package body Com_Slave is procedure Init_Slave (Init_Connection : in out Transport.Connection_Id; Init_Host_Orb : in Transport_Defs.Host_Id; Init_My_Host : in out Transport_Defs.Host_Id; Init_Socket_Orb : in Transport_Defs.Socket_Id; Init_My_Socket : out Transport_Defs.Socket_Id) is Status : Transport_Defs.Status_Code; Network_Name : constant Transport_Defs.Network_Name := "TCP/IP"; Count : Natural; Transmit_Socket_Data : Byte_Defs.Byte_String (1 .. 2); Transmit_Host_Data : Byte_Defs.Byte_String (1 .. 4); begin loop Transport.Open (Init_Connection, Status, Network_Name); exit when Transport.Is_Open (Init_Connection) = True; end loop; Transmit_Socket_Data := Byte_Defs.Byte_String (Transport.Local_Socket (Init_Connection)); Transmit_Host_Data := Byte_Defs.Byte_String (Transport.Local_Host (Init_Connection)); Text_Io.Put ("My Socket esclave : "); Text_Io.Put_Line (Utils.Byte_String_To_String (Byte_Defs.Byte_String (Transport.Local_Socket (Init_Connection)))); Text_Io.Put ("My Machine esclave : "); Text_Io.Put_Line (Host_Id_Io.Image (Transport.Local_Host (Init_Connection))); Text_Io.Put_Line ("Slave is opened"); loop Transport.Connect (Init_Connection, Status, Init_Host_Orb, Init_Socket_Orb, Duration'Last); exit when Transport.Is_Connected (Init_Connection) = True; end loop; Text_Io.Put_Line ("Slave is active connected"); Transport.Transmit (Init_Connection, Status, Transmit_Socket_Data, Count, Duration'Last); Transport.Transmit (Init_Connection, Status, Transmit_Host_Data, Count, Duration'Last); Transport.Disconnect (Init_Connection); Text_Io.Put_Line ("Slave is deconnected"); loop Transport.Connect (Init_Connection, Status, Duration'Last); exit when Transport.Is_Connected (Init_Connection) = True; end loop; Text_Io.Put_Line ("Slave is passive connected"); Transport.Disconnect (Init_Connection); Text_Io.Put_Line ("Slave is deconnected"); --Transport.Close (Init_Connection); --Text_Io.Put_Line ("Slave is closed"); end Init_Slave; task body Slave_Machine is Connection : Transport.Connection_Id; Network_Name : constant Transport_Defs.Network_Name := "TCP/IP"; Host_Orb : constant Transport_Defs.Host_Id := Transport.Local_Host (Network_Name); Host_Slave : Transport_Defs.Host_Id (1 .. 4); Socket_Orb : Transport_Defs.Socket_Id (1 .. 2) := (10, 49); Socket_Slave : Transport_Defs.Socket_Id (1 .. 2); Status : Transport_Defs.Status_Code; Count : Natural; Data_Receive_Orb : Byte_Defs.Byte_String (1 .. 300); Message : String (1 .. 300); Byte_Verif : Byte_Defs.Byte := 0; String_Verif : Byte_Defs.Byte_String (1 .. 2); begin Init_Slave (Connection, Host_Orb, Host_Slave, Socket_Orb, Socket_Slave); loop Transport.Connect (Connection, Status, Duration'Last); exit when Transport.Is_Connected (Connection) = True; end loop; Text_Io.Put_Line ("I am trying to receive the message"); Transport.Receive (Connection, Status, Data_Receive_Orb, Count, Duration'Last); if Byte_Defs."=" (Data_Receive_Orb (1), Byte_Verif) = True then Text_Io.Put_Line ("new connection request"); else Text_Io.Put_Line ("normal message"); end if; String_Verif := Data_Receive_Orb (2 .. 3); Text_Io.Put_Line (Utils.Byte_String_To_String (String_Verif)); Text_Io.Put_Line (Transport_Defs.Image (Status)); Text_Io.Put_Line (Utils.Byte_String_To_String (Data_Receive_Orb)); Transport.Disconnect (Connection); Transport.Close (Connection); end Slave_Machine; end Com_Slave;
nblk1=5 nid=0 hdr6=a [0x00] rec0=16 rec1=00 rec2=01 rec3=016 [0x01] rec0=11 rec1=00 rec2=02 rec3=068 [0x02] rec0=15 rec1=00 rec2=03 rec3=042 [0x03] rec0=14 rec1=00 rec2=04 rec3=010 [0x04] rec0=0d rec1=00 rec2=05 rec3=000 tail 0x2175da7b087b8877a333d 0x42a00088462060003