Specification of package Tgx.Ios.Gnat_Ios







 ========================================================================= --
 ===                                                                   === --
 ===                 Top Graph'X CORBA Implementation                  === --
 ===                                                                   === --
 ===                 Copyright (c) 1996, Top Graph'X.                  === --
 ===                                                                   === --
 ===                     --- Copyright Notice ---                      === --
 ===                                                                   === --
 ===    This software is protected as an unpublished work under the    === --
 ===     Copyright Act of 1976.  All rights reserved.  Top Graph'X.    === --
 ===                                                                   === --
 ========================================================================= --
with Gnat.Sockets;
with Tgx.System_Ios;
package Tgx.Ios.Gnat_Ios is
    Local declarations usually provided by Tgx.System_Ios
   type Socket_Address_Family is ( Af_Unspec, Af_Unix, Af_Inet ) ;
   for Socket_Address_Family use ( Af_Unspec => 0,
                                   Af_Unix   => 1,
                                   Af_Inet   => 2) ;
   for Socket_Address_Family'size use 16 ;      

   type Integer_32 is  range - 2 ** 31 .. (2 ** 31) - 1;
   subtype Descriptor is Integer_32 range 0 .. 1023 ;
   type Descriptor_Mask is array (Descriptor) of Boolean ;
    end Local declarations usually provided by Tgx.System_Ios

   type Socket_Protocol is (No_Proto, Tcp, Udp) ;

    subtyping necessary types to provide appropriate visibility
   type Port is new Gnat.Sockets.Port_Type range 0 .. 65535;
   for Port'size use 16;
   subtype Socket_Type is Gnat.Sockets.Socket_Type;
   Invalid_File : constant Gnat.Sockets.Socket_Type := Gnat.Sockets.No_Socket;

   type Socket_Connection is new Io_Connection with
   record
      Host     : String_Pointer ;
      Tcp_Port : Port ;
      Family   : Socket_Address_Family ;
      Protocol : Socket_Protocol ;
      Fd       : Gnat.Sockets.Socket_Type := Invalid_File;
      Fd_Bit   : Descriptor ;
      Opened   : Boolean := False;
   end record ;
   type Socket_Access is access all Socket_Connection'class ;

   procedure Open (This : access Socket_Connection) ;

   procedure Close (This : access Socket_Connection) ;

   procedure Read ( This   : access Socket_Connection ;
                    Buffer : in System.Address ;
                    Number : in out Natural ) ;

   procedure Write ( This   : access Socket_Connection ;
                     Buffer : in System.Address ;
                     Number : in Natural ) ;

   function Bytes_Per_Io_Unit (This : access Socket_Connection)
      return Natural ;

   function Amount_Readable (This : access Socket_Connection)
      return Natural ;

    Returns the URL indicating the sending client
   function Url (Client   : access Socket_Connection)
      return Standard.String ;

   type Service_Connection is new Io_Server with
   record
      Tcp_Port : Port;
      Family   : Socket_Address_Family ;
      Protocol : Socket_Protocol ;
      File     : String_Pointer ;
      Info     : Gnat.Sockets.Sock_Addr_Type ;
      Fd       : Gnat.Sockets.Socket_Type := Invalid_File;
      Fd_Bit   : Descriptor ;
      Opened   : Boolean := False;
   end record ;
   type Service_Access is access all Service_Connection'class ;

   procedure Open (This : access Service_Connection) ;

   procedure Close (This : access Service_Connection) ;

   procedure New_Connection ( Server   : access Service_Connection ;
                              No_Guard : in Boolean := True;
                              Result   : in out Io_Connection_Access);

    Returns the URL used by clients to connect to server
   function Url (Server   : access Service_Connection)
      return Standard.String ;
   procedure Use_Ip_In_Urls (Mode : in Boolean) ;

   function Ip_Name (Host_Name : in String) return String ;


   ---------------------------------------------------------------------
    Multicast 
   ---------------------------------------------------------------------
   Multicast_Emission_Error : exception ;
   type Socket_Multicast_Reception is new Io_Datagram_Reception  with
   record
      Host     : String_Pointer ;
      Udp_Port : Port ;
      Family   : Socket_Address_Family ;
      Protocol : Socket_Protocol := Udp ;
      Multicast: String_Pointer ;
      Internet_Addr : Gnat.Sockets.Sock_Addr_Type ;
      Fd       : Gnat.Sockets.Socket_Type := Invalid_File;
      Fd_Bit   : Descriptor ;
      Opened   : Boolean := False;
   end record ;
   type Socket_Multicast_Reception_Access is access all Socket_Multicast_Reception'class ;

   procedure Open (This : access Socket_Multicast_Reception ) ;

   procedure Close (This : access Socket_Multicast_Reception ) ;

   procedure Read ( This   : access Socket_Multicast_Reception ;
                    Buffer : in System.Address ;
                    Number : in out Natural ) ;

   procedure Write ( This   : access Socket_Multicast_Reception ;
                     Buffer : in System.Address ;
                     Number : in Natural ) ;

   function Bytes_Per_Io_Unit (This : access Socket_Multicast_Reception)
      return Natural ;

   function Amount_Readable (This : access Socket_Multicast_Reception)
      return Natural ;

    Directly derived from Raw Datagram Emission
   type Socket_Multicast_Emission is new Io_Datagram_Emission  with
   record
      Host          : String_Pointer ;
      Udp_Port      : Port ;
      Family        : Socket_Address_Family ;
      Protocol      : Socket_Protocol := Udp ;
      Multicast     : String_Pointer ;
      Internet_Addr : Gnat.Sockets.Sock_Addr_Type ;
      Fd            : Gnat.Sockets.Socket_Type := Invalid_File;
      Opened        : Boolean := False;
    end record ;
   type Socket_Multicast_Emission_Access is access all Socket_Multicast_Emission'class ;

   procedure Open (This : access Socket_Multicast_Emission ) ;

   procedure Close (This : access Socket_Multicast_Emission ) ;

   procedure Read ( This   : access Socket_Multicast_Emission ;
                    Buffer : in System.Address ;
                    Number : in out Natural ) ;

   procedure Write ( This   : access Socket_Multicast_Emission ;
                     Buffer : in System.Address ;
                     Number : in Natural ) ;

   function Bytes_Per_Io_Unit (This : access Socket_Multicast_Emission)
      return Natural ;

   function Amount_Readable (This : access Socket_Multicast_Emission)
      return Natural ;

   procedure Get_Recv_Buffer ( S    : in Gnat.Sockets.Socket_Type ;
                               Size : in out Integer_32 ;
                               Ok   : out boolean);

   procedure Set_Recv_Buffer ( S    : in Gnat.Sockets.Socket_Type ;
                               Size : in Integer_32 ;
                               Ok   : out boolean);

   procedure Get_Send_Buffer ( S    : in Gnat.Sockets.Socket_Type ;
                               Size : in out Integer_32 ;
                               Ok   : out boolean);

   procedure Set_Send_Buffer ( S    : in Gnat.Sockets.Socket_Type ;
                               Size : in Integer_32 ;
                               Ok   : out boolean);

   procedure Get_Multicast_Ttl ( S   : in Gnat.Sockets.Socket_Type ;
                                 Ttl : in out Tgx.System_Ios.Byte ;
                                 Ok  : out boolean);

   procedure Set_Multicast_Ttl ( S   : in Gnat.Sockets.Socket_Type ;
                                 Ttl : in Tgx.System_Ios.Byte ;
                                 Ok  : out boolean);
end Tgx.Ios.Gnat_Ios ;



List of definition uses










This page was generated by PrismTech's ada2html on Friday Mai 12 2006 16:18