|
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: 2838 (0xb16) Types: TextFile Notes: R1k Text-file segment
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000 └─ ⟦5a81ac88f⟧ »Space Info Vol 1« └─⟦511b47faf⟧ └─⟦this⟧
with Transport, Transport_Defs, Text_Io, Utils, Byte_Defs, Host_Id_Io; package body Communication is task body Client is Connection : Transport.Connection_Id; Status : Transport_Defs.Status_Code; Network_Name : constant Transport_Defs.Network_Name := "TCP/IP"; Count : Natural; Receive_Data : Byte_Defs.Byte_String (1 .. 56); Socket : constant Transport_Defs.Socket_Id (1 .. 2) := (10, 49); begin loop Transport.Open (Connection, Status, Network_Name, Socket); exit when Transport.Is_Open (Connection) = True; end loop; Text_Io.Put_Line ("Client : Open is OK"); loop Transport.Connect (Connection, Status, Duration'Last); exit when Transport.Is_Connected (Connection) = True; end loop; Text_Io.Put_Line (" Client : Connection is OK"); Transport.Receive (Connection, Status, Receive_Data, Count, Duration'Last); Text_Io.Put ("Message client : "); Text_Io.Put_Line (Utils.Byte_String_To_String (Receive_Data)); Transport.Disconnect (Connection); Text_Io.Put_Line ("Client : Disconnect is OK"); end Client; task body Serveur is Connection : Transport.Connection_Id; Status : Transport_Defs.Status_Code; Network_Name : constant Transport_Defs.Network_Name := "TCP/IP"; Count : Natural; Data_Entry : constant String := ("hello world"); Transmit_Data : Byte_Defs.Byte_String (1 .. Data_Entry'Last) := Utils.String_To_Byte_String (Data_Entry); -- Host : constant Transport_Defs.Host_Id (1 .. 4) := (193, 54, 146, 133); Host : constant Transport_Defs.Host_Id := Transport.Local_Host (Network_Name); Socket : constant Transport_Defs.Socket_Id (1 .. 2) := (10, 49); begin Text_Io.Put ("Message serveur : "); Text_Io.Put_Line (Data_Entry); loop Transport.Open (Connection, Status, Network_Name); exit when Transport.Is_Open (Connection) = True; end loop; Text_Io.Put_Line ("Serveur : Open is OK"); loop Transport.Connect (Connection, Status, Host, Socket, Duration'Last); -- Text_Io.Put_Line (Host_Id_Io.Image (Host)); exit when Transport.Is_Connected (Connection) = True; end loop; Text_Io.Put_Line ("Serveur : Connection is OK"); Transport.Transmit (Connection, Status, Transmit_Data, Count, Duration'Last); Text_Io.Put_Line ("Serveur : Transmit_Data is down"); Transport.Disconnect (Connection); Text_Io.Put_Line ("Serveur : Disconnect is OK"); end Serveur; end Communication