|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T
Length: 6985 (0x1b49)
Types: TextFile
Names: »TRANSPORT_SPEC«
└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
└─⟦5cb1d1d7f⟧ »DATA«
└─⟦3b1ee7bd8⟧
└─⟦this⟧
with Byte_Defs;
with Transport_Defs;
package Transport is
--pragma Closed_Private_Part;
-- pragma Closed_Private_Part;
type Connection_Id is private;
-- Identifies the local resources associated with a connection.
Null_Connection_Id : constant Connection_Id;
function Local_Host (Network : Transport_Defs.Network_Name)
return Transport_Defs.Host_Id;
-- The ID which identifies your machine in the given NETWORK.
-- All defined network_names can be scanned:
type Network_Name_Iterator is limited private;
procedure Init (Iter : in out Network_Name_Iterator);
procedure Next (Iter : in out Network_Name_Iterator);
function Done (Iter : Network_Name_Iterator) return Boolean;
function Value (Iter : Network_Name_Iterator)
return Transport_Defs.Network_Name;
-- All open connection_id's can be scanned:
type Connection_Id_Iterator is limited private;
procedure Init (Iter : in out Connection_Id_Iterator);
procedure Next (Iter : in out Connection_Id_Iterator);
function Done (Iter : Connection_Id_Iterator) return Boolean;
function Value (Iter : Connection_Id_Iterator) return Connection_Id;
procedure Open (Connection : out Transport.Connection_Id;
Status : out Transport_Defs.Status_Code;
Network : Transport_Defs.Network_Name;
Local_Socket : Transport_Defs.Socket_Id :=
Transport_Defs.Null_Socket_Id);
-- Allocate the local resources required to establish a
-- connection. Any subsequent connection which may be
-- established will be via the given NETWORK, using the given
-- LOCAL_SOCKET. If LOCAL_SOCKET = NULL_SOCKET_ID, the
-- transport service will invent a socket_id which is not
-- currently in use, and assign it to this connection.
procedure Close (Connection : Transport.Connection_Id);
-- Deallocate local resources.
-- If the connection is connected, disconnect it.
-- If the connection is not open, do nothing.
procedure Connect (Connection : Transport.Connection_Id;
Status : out Transport_Defs.Status_Code;
Remote_Host : Transport_Defs.Host_Id;
Remote_Socket : Transport_Defs.Socket_Id;
Max_Wait : Duration := Duration'Last);
-- Initiate a connection to the specified remote host and socket.
-- The CONNECTION must be open.
procedure Connect (Connection : Transport.Connection_Id;
Status : out Transport_Defs.Status_Code;
Max_Wait : Duration := Duration'Last);
-- Wait for a connection initiated by some other task.
-- The CONNECTION must be open.
procedure Disconnect (Connection : Transport.Connection_Id);
-- Break a connection.
-- If the CONNECTION is not connected, do nothing.
function Is_Open (Connection : Transport.Connection_Id) return Boolean;
function Is_Connected (Connection : Transport.Connection_Id) return Boolean;
-- function is_connecting_passive
-- (connection : transport.connection_id)
-- return Boolean;
-- function is_connecting_active
-- (connection : transport.connection_id)
-- return Boolean;
function Network (Connection : Transport.Connection_Id)
return Transport_Defs.Network_Name;
function Local_Host (Connection : Transport.Connection_Id)
return Transport_Defs.Host_Id;
function Local_Socket (Connection : Transport.Connection_Id)
return Transport_Defs.Socket_Id;
function Remote_Host (Connection : Transport.Connection_Id)
return Transport_Defs.Host_Id;
function Remote_Socket (Connection : Transport.Connection_Id)
return Transport_Defs.Socket_Id;
procedure Transmit (Connection : Transport.Connection_Id;
Status : out Transport_Defs.Status_Code;
Data : Byte_Defs.Byte_String;
Count : out Natural;
Max_Wait : Duration := Duration'Last;
More : Boolean := False);
-- Transmit some data. The CONNECTION must be connected.
-- STATUS is returned OK, unless the connection is broken.
-- DATA is the data to be transmitted. COUNT is returned the
-- number of bytes actually transmitted. This may differ
-- from DATA'LENGTH if the connection breaks, or if the
-- operation times out.
-- MAX_WAIT is the maximum amount of time to spend trying to
-- transmit the data. The operation completes when all the
-- DATA bytes have been transmitted, or when MAX_WAIT
-- expires, whichever comes first.
-- MORE indicates that the service may hold the data in its
-- local buffers, to be combined with more data which the
-- client is about to transmit. This is a performance hint
-- only: the service is free to ignore it and transmit all
-- data as soon as it gets it.
-- This operation may simply store data in a local buffer,
-- and actually transmit it at some future opportunity. If
-- buffering is involved, the service assumes responsibility
-- for transmitting the buffered data.
procedure Receive (Connection : Transport.Connection_Id;
Status : out Transport_Defs.Status_Code;
Data : out Byte_Defs.Byte_String;
Count : out Natural;
Max_Wait : Duration := Duration'Last);
-- Receive some data. The CONNECTION must be connected.
-- STATUS is returned OK, unless the connection is broken.
-- DATA is the buffer into which to store received data.
-- COUNT is returned the number of bytes actually stored.
-- This may be less than DATA'LENGTH.
-- MAX_WAIT is the maximum amount of time to spend waiting
-- to receive some data. The operation completes when one
-- or more DATA bytes have been received, or when MAX_WAIT
-- expires, whichever comes first.
-- This procedure does not wait to fill up the DATA buffer.
-- As soon as ANY data are received, it returns them.
function Hash (Connection : Transport.Connection_Id) return Natural;
-- Calculate a value suitable for hashing.
function Is_Connecting_Passive
(Connection : Transport.Connection_Id) return Boolean;
function Is_Connecting_Active
(Connection : Transport.Connection_Id) return Boolean;
private
type Connection_Type;
type Connection_Id is access Connection_Type;
Null_Connection_Id : constant Connection_Id := null;
type Network_Name_Iterator is new Integer;
type Connection_Id_Iterator is new Connection_Id;
end Transport;