comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@bix.com
Subject: Re: GNAT, LINUX, KDE
Date: 1999/11/28
Date: 1999-11-28T00:00:00+00:00	[thread overview]
Message-ID: <hvh04.351$vq2.31927@typhoon-sf.snfc21.pbi.net> (raw)
In-Reply-To: 81lkb2$mra3@ftp.kvaerner.com

>>  If similar communication subsystem would be a part of a standard
>>or semi-standard Ada environment  it could provide an excellent
>>platform  for many great things and make Ada more competitive
>>in some areas where C++ has better positions.
>You're not the only one who think along those lines.
>
>The reason that I want my own binding, is that I want something that "works
>with" Ada, not just something that Ada tolerates. I want the compiler to catch
>as many as possible of my mistakes.
  I think it would be unfortunate if a lot of effort went into
multiple, slightly different, incompatible Ada packages.  Since CLAW
works, and, having written the Sockets packages I think they are
quite usable, I naturally propose that others either use them, or at
least use their interface.  A quick glance is:

    -- Socket_Type   is a stream communication socket.
    -- It's a Controlled type so it will be automatically Closed
    -- when it goes out of scope.

    -- Async_Socket_Type (in Claw.Sockets.Non_Blocking) allows "interrupts"
    -- on Socket_Types.

    -- Datagram_Type (in Claw.Sockets.Datagrams) is a datagram communication socket.

    -- Server_Type  is a simple server accepting calls from clients,
    -- using polling or waiting for client arrival notification.

    -- Async_Server_Type  is a server with a When_Client interrupt, rather
    -- than polling or waiting, for client arrival notification.

    -- Socket_Stream_Type   is a new Root_Stream_Type for T'Read on sockets.

  procedure Open(Socket     : in out Socket_Type;
                 Domain_Name: in     String;
                 Port       : in     Port_Type;
                 Timeout    : in     Duration := 30.0);
  procedure Open(Socket  : in out Socket_Type;
                 Address : in     Network_Address_Type;
                 Port    : in     Port_Type;
                 Timeout : in     Duration := 30.0);
  procedure Close(Socket : in out Socket_Type);
  procedure Get (Socket : in out Socket_Type;
                 Item   :    out String;
                 Last   :    out Natural);
  procedure Get (Socket  : in out Socket_Type;
                 Timeout : in     Duration;
                 Item    :    out String;
                 Last    :    out Natural);
  procedure Put(Socket : in out Socket_Type;
                Phrase : in     String);
  procedure Put_Line(Socket : in out Socket_Type;
                     Phrase : in     String);
  similar IO for non-string data, records, Ada.Streams, etc.

  A Server_Type is similar but its most important routine is:

  procedure Greet(Server : in out Server_Type;
                  Socket : in out Socket_Type'Class);
        -- Wait for some client to access Server, then set Socket to
        -- an open socket connected to that client and return.
  There's also:
  type Async_Server_Type is new Server_Type with private;
  -- Server with When_Client notification of client arrival.
  -- Does not block, but the routine overiding When_Client is
  -- called on a new client's arrival.  When_Client should
  -- then do a Greet, presumably in a rendezvous with a worker
  -- task.

  function Get_Handle (Socket : in Root_Socket_Type'Class)
                return Socket_Handles;
  -- A way to get a Windows handle for a socket if you really
  -- need to pass it to some other low-level stuff.

  procedure Get_Socket_From_Handle (Socket : in out Socket_Type;
                                    Handle : in     Socket_Handles);
  -- A way to get a Claw socket from an existing Windows socket
  -- handle.

  There are of course a bunch of utility routines for finding who
you are connected to, looking up names, making or tearing apart
IP addresses, etc.
  CLAW handles the Windows messaging stuff internally.  The
standard CLAW exceptions like Not_Valid_Error, Not_Found, etc
are generated as appropriate.  There's also
  Busy : Exception;  -- raised when a second task attempts an operation
                     -- on a socket which is already in the middle of
                     -- an operation from a different task.  This
                     -- likely would result in a race condition.

  I really doubt there would be any copyright problems reusing the
spec of Claw.Sockets, since compatibility is obviously in the
interest of RR Software.




  parent reply	other threads:[~1999-11-28  0:00 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-22  0:00 GNAT, LINUX, KDE Robert C. Leif, Ph.D.
1999-11-23  0:00 ` David Botton
1999-11-23  0:00 ` Preben Randhol
1999-11-23  0:00   ` Vladimir Olensky
1999-11-23  0:00     ` Preben Randhol
1999-11-24  0:00       ` Vladimir Olensky
1999-11-24  0:00         ` Preben Randhol
1999-11-23  0:00     ` David Botton
1999-11-24  0:00       ` tmoran
1999-11-24  0:00         ` Geoff Bull
1999-11-24  0:00           ` Robert C. Leif, Ph.D.
1999-11-25  0:00             ` David Botton
1999-11-26  0:00               ` Vladimir Olensky
1999-11-26  0:00                 ` Tarjei Jensen
1999-11-26  0:00                   ` Vladimir Olensky
1999-11-28  0:00                   ` Aidan Skinner
1999-11-29  0:00                     ` Tarjei Jensen
1999-12-01  0:00                       ` Aidan Skinner
1999-12-08  0:00                       ` Jeffrey L Straszheim
1999-12-10  0:00                         ` Tarjei Jensen
1999-11-28  0:00                   ` tmoran [this message]
1999-11-25  0:00             ` Geoff Bull
1999-11-27  0:00               ` XML-HTML Forms local execution was " Robert C. Leif, Ph.D.
1999-11-27  0:00                 ` David Botton
     [not found]                 ` <01bf38e6$27820850$022a6282@dieppe>
1999-11-27  0:00                   ` Simon Wright
1999-11-28  0:00                 ` tmoran
1999-11-28  0:00                 ` Vladimir Olensky
1999-11-29  0:00                 ` Alfred Hilscher
1999-11-25  0:00           ` tmoran
1999-11-24  0:00       ` Aidan Skinner
1999-11-29  0:00       ` GUI, HTTP and LynxOS ( Was:Re: GNAT, LINUX, KDE) Vladimir Olensky
1999-11-29  0:00         ` Ted Dennison
1999-11-29  0:00           ` Ed Falis
1999-12-07  0:00             ` Mario Amado Alves
1999-12-08  0:00               ` GUI, HTTP and LynxOS Robert C. Leif, Ph.D.
1999-12-09  0:00                 ` Mario Amado Alves
1999-12-09  0:00                   ` tmoran
1999-12-11  0:00                   ` David Botton
1999-11-29  0:00       ` GUI, XML,HTTP and ORBlets (Was Re: GNAT, LINUX, KDE) Vladimir Olensky
1999-11-23  0:00   ` GNAT, LINUX, KDE Robert C. Leif, Ph.D.
1999-11-24  0:00     ` Preben Randhol
1999-11-24  0:00       ` Robert C. Leif, Ph.D.
1999-11-25  0:00         ` Preben Randhol
1999-11-24  0:00 ` Aidan Skinner
  -- strict thread matches above, loose matches on Subject: below --
1999-11-22  0:00 Robert C. Leif, Ph.D.
1999-11-22  0:00 Alfred Hilscher
1999-11-23  0:00 ` Preben Randhol
1999-11-23  0:00   ` David Starner
1999-11-23  0:00     ` Preben Randhol
1999-11-24  0:00   ` Al Christians
1999-11-23  0:00 ` Dale Pontius
1999-11-23  0:00 ` Robert Dewar
1999-11-23  0:00 ` Aidan Skinner
1999-11-23  0:00   ` Larry Kilgallen
1999-11-23  0:00     ` Preben Randhol
1999-11-23  0:00       ` Fraser
1999-11-24  0:00     ` Aidan Skinner
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox