DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ T V

⟦eceee29fb⟧ TextFile

    Length: 4268 (0x10ac)
    Types: TextFile
    Names: »V«

Derivation

└─⟦5f3412b64⟧ Bits:30000745 8mm tape, Rational 1000, ENVIRONMENT 12_6_5 TOOLS 
    └─ ⟦91c658230⟧ »DATA« 
        └─⟦458657fb6⟧ 
            └─⟦a5bbbb819⟧ 
                └─⟦this⟧ 
└─⟦d10a02448⟧ Bits:30000409 8mm tape, Rational 1000, ENVIRONMENT, D_12_7_3
    └─ ⟦fc9b38f02⟧ »DATA« 
        └─⟦9b46a407a⟧ 
            └─⟦eec0a994f⟧ 
                └─⟦this⟧ 

TextFile

with System_Utilities;
with Telnet_Protocol;
with Terminal_Specific;

package Telnet_Port is

    subtype Port_Type is System_Utilities.Port;
    subtype File_Type is Terminal_Specific.File_Type;

    function Name (Port : Port_Type) return String
        renames System_Utilities.Terminal_Name;
    -- A port may be read or written by opening a File_Type object on
    -- it, with Open.Name => Name (Port); and using the Read and Write
    -- operations defined on File_Type (see package Terminal_Specific).

    function Port (File : File_Type) return Port_Type;
    -- Return the port on which the given File was opened.
    -- If File was not opened on a port, raise Not_A_Telnet_Port.

    function Is_A_Telnet_Port (Port : Port_Type) return Boolean;
    function Is_A_Telnet_Port (File : File_Type) return Boolean;
    -- Return true iff the given object identifies a Telnet port.
    -- Is_A_Telnet_Port (File) = Is_A_Telnet_Port (Port (File)).

    Not_A_Telnet_Port : exception;
    -- Raised if any of the operations below are attempted on
    -- a File that was not opened on a Telnet port.

    -- Although the operations below take File_Type parameters, they
    -- actually manipulate underlying permanent Port data structures.
    -- One may open and close File_Type handles repeatedly on a given
    -- port, without changing the state associated with that port.
    -- In particular, closing a File does NOT disconnect the port, nor
    -- reset its Convert_Received_New_Line_to_CR switch to the default.
    -- design note: File_Type is used instead of Port_Type to force
    -- the client of this package to obtain a lock on the port before
    -- manipulating its state; if the lock cannot be obtained then the
    -- state cannot be manipulated.  This is a feature: it allows a job
    -- (for example the login manager or core editor) to prevent other
    -- jobs from messing with the state of its port.

    -- For each Telnet port there is a Boolean that, if True, causes each
    -- received CRLF (Telnet new_line) sequence to be read as CR alone.
    -- The purpose of this switch is to support Telnet terminal servers
    -- that transmit the single keystroke [return] as a Telnet new_line.
    -- At system boot time, every port's switch is set to True.  It may
    -- be changed at any time.

    procedure Set_Convert_Received_New_Line_To_Cr
                 (File : File_Type; Enabled : Boolean := True);
    -- Set the switch to the given value.

    function Get_Convert_Received_New_Line_To_Cr
                (File : File_Type) return Boolean;
    -- Return the present value of the switch.

    procedure Connect (File : File_Type;
                       Connection : Telnet_Protocol.Connection_Id);
    -- If Is_Connected (File) then Disconnect (File);
    -- Bind the Telnet port identified by File to the given Connection.

    procedure Connect (File : File_Type;  
                       Max_Wait : Duration := Duration'Last);
    -- If Is_Connected (File) then do nothing and return immediately.
    -- Otherwise, wait for an incoming connection on TCP/IP socket 23.
    -- If it arrives within Max_Wait, open a Telnet connection, and
    -- bind it to the Telnet port identified by the given File.
    -- Otherwise, raise Not_Connected.

    function Is_Connected (File : File_Type) return Boolean;
    -- Return true iff the given File identifies a Telnet port that
    -- is bound to a Telnet_Protocol.Connection_Id that is connected.

    -- If a Telnet port is connected, then data written to it will
    -- be transmitted on the associated Telnet connection, and
    -- data received on that connection may be read from the port.

    -- If a Telnet port is not connected, then data written to it
    -- will be discarded (ignored), and any attempt to read from it
    -- will first execute Connect (File, Max_Wait).

    procedure Disconnect (File : File_Type);
    -- if Is_Connected (File) then Telnet_Protocol.Close (Connection (File)).

    function Connection (File : File_Type) return Telnet_Protocol.Connection_Id;
    -- Return the Connection that is currently bound to the Telnet port
    -- that is identified by File.  If there is none, raise Not_Connected.

    Not_Connected : exception;

end Telnet_Port;