From: Eric Jacoboni <jaco@neottia.net>
Subject: Re: TCP/IP Sockets with GNAT.Sockets
Date: Mon, 02 May 2005 19:56:18 +0200
Date: 2005-05-02T19:56:18+02:00 [thread overview]
Message-ID: <020520051956181888%jaco@neottia.net> (raw)
In-Reply-To: 42765108$0$22419$ba620e4c@news.skynet.be
In article <42765108$0$22419$ba620e4c@news.skynet.be>, Adrien Plisson
<aplisson-news@stochastique.net> wrote:
> > S : String := "Hello";
> > SEA : Stream_Element_Array(1..S'Length);
> > for SEA'Address use S(S'First)'Address;
> > Last : Stream_Element_Offset;
> > Send_Socket( Socket, SEA, Last );
>
> (i'm sorry i'm gonna be a bit rude) beuark !
Agree. It's not the sort of things i expected to write with Ada... But,
that's the only code that fits my needs.
> this is implementation dependant:
> - what if Character'Size /= Stream_Element'Size ?
> - what if the memory organization of Stream_Element_Array does not
> match the one for a String ?
For the second point, Stream_Element_Array is defined as an array of
Stream_Element, so i suppose it match the memory organization of a
String, isn't it ?
> you'd better write this:
>
> declare
> Socket : Socket_Type;
> Channel : Stream_Access;
> begin
> -- open your socket here, then...
> Channel := Stream( Socket );
>
> String'Write( Channel, "Hello" );
> -- close your socket here...
> end;
Have you tried this code with a server not Ada aware? Have you tried to
exchange messages with, say, a POP3 server? (to send and to read) I've
tried to use Streams for that, but i never succeeded to make it work...
If a cleaner solution exists, why the hell cannot we find _any_
example?
--
jaco
next prev parent reply other threads:[~2005-05-02 17:56 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-02 2:42 TCP/IP Sockets with GNAT.Sockets fabio de francesco
2005-05-02 5:58 ` Eric Jacoboni
2005-05-02 12:11 ` Adrien Plisson
2005-05-02 14:55 ` fabio de francesco
2005-05-02 16:10 ` Adrien Plisson
2005-05-02 17:56 ` Eric Jacoboni [this message]
2005-05-02 18:30 ` Poul-Erik Andreasen
2005-05-02 19:10 ` Simon Wright
2005-05-03 13:00 ` Poul-Erik Andreasen
2005-05-03 21:48 ` Simon Wright
2005-05-04 8:01 ` Character'First, ASCII.NUL and others (Was: Re: TCP/IP Sockets with GNAT.Sockets) Adrien Plisson
2005-05-04 13:40 ` Poul-Erik Andreasen
2005-05-02 20:37 ` TCP/IP Sockets with GNAT.Sockets fabio de francesco
2005-05-02 20:52 ` Adrien Plisson
2005-05-03 12:04 ` fabio de francesco
2005-05-03 12:22 ` Adrien Plisson
2005-05-03 13:17 ` Poul-Erik Andreasen
2005-05-02 20:44 ` Adrien Plisson
2005-05-02 22:10 ` Eric Jacoboni
2005-05-02 23:42 ` tmoran
2005-05-02 19:39 ` Björn
2005-05-02 20:22 ` fabio de francesco
2005-05-09 4:03 ` Dave Thompson
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox