comp.lang.ada
 help / color / mirror / Atom feed
* GNAT.Sockets
@ 2002-02-23 12:20 Alexei Polkhanov
  2002-02-25 18:11 ` GNAT.Sockets Pascal Obry
  2002-03-23 23:53 ` GNAT.Sockets Volkert
  0 siblings, 2 replies; 9+ messages in thread
From: Alexei Polkhanov @ 2002-02-23 12:20 UTC (permalink / raw)


Hello.
    Does GNAT.Sockets from Gnat-3.14 works on Win2000 ?
    Somehow I manage to get some visible (by sniffer) activity on stack
running my own code.
Example taken from g-sockets.ads works fine on all UNIX platforms I have
tried, but
again on Win2000 it does not, raising  "GNAT.SOCKETS.SOCKET_ERROR: [0] No
error" or "GNAT.SOCKETS.HOST_ERROR: Unknown error"
I suspect NT version little bit broken (?)
What about other GNAT.* packages ? Are they work on NT ? 2000 ? XP ?
Of course I can use Win32 bindings from GNAT, but then again it is platform
specific. In that case I better write low level socket stuff in C and bind
Ada code to it. What is GNAT.* for ?

Code I tried (below) gives me: STORAGE_ERROR: EXCEPTION_STACK_OVERFLOW.

with GNAT.Sockets; use GNAT.Sockets;
with Ada.Text_IO;
with Ada.Exceptions; use Ada.Exceptions;
procedure Main is
    Address  : Sock_Addr_Type;
    Socket   : Socket_Type;
    Channel  : Stream_Access;
begin
    Initialize (Process_Blocking_IO => False);
    Address.Addr := Addresses (Get_Host_By_Name("mail.ica.net"), 1);
    Address.Port := 25;
    Create_Socket (Socket);
    Connect_Socket (Socket, Address);
    Channel := Stream (Socket);
    Ada.Text_IO.Put_Line (String'Input (Channel));
    Close_Socket(Socket);
    Finalize;

    exception when E : others =>
        Ada.Text_IO.Put_Line
             (Exception_Name (E) & ": " & Exception_Message (E));
end Main;






^ permalink raw reply	[flat|nested] 9+ messages in thread
* GNAT.Sockets
@ 2007-10-09 13:04 Bartek
  2007-10-09 15:10 ` GNAT.Sockets anon
  0 siblings, 1 reply; 9+ messages in thread
From: Bartek @ 2007-10-09 13:04 UTC (permalink / raw)


Hi,

I'm trying to establish an Inter Process Communication using Sockets.
The connection is stable, and I can allready send Strings out oy my Ada 
app. But the Problem I have, is to read data out of the stream.

I'm still not sure, if the Ada.Streams.Read function is usefull for my 
problem!?

Thanks for Advices.

BP



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-10-10  4:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-23 12:20 GNAT.Sockets Alexei Polkhanov
2002-02-25 18:11 ` GNAT.Sockets Pascal Obry
2002-03-23 23:53 ` GNAT.Sockets Volkert
2002-03-24  7:22   ` GNAT.Sockets Pascal Obry
2002-03-24  8:56   ` GNAT.Sockets Volkert
  -- strict thread matches above, loose matches on Subject: below --
2007-10-09 13:04 GNAT.Sockets Bartek
2007-10-09 15:10 ` GNAT.Sockets anon
2007-10-09 20:36   ` GNAT.Sockets Maciej Sobczak
2007-10-10  4:52     ` GNAT.Sockets Simon Wright

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