comp.lang.ada
 help / color / mirror / Atom feed
From: Michal Zalewski <lcamtuf@dione.ids.pl>
Subject: Re: Get_Line vs Adasockets
Date: 2000/08/14
Date: 2000-08-14T15:37:57+00:00	[thread overview]
Message-ID: <Pine.LNX.4.21.0008141730540.13077-100000@dione.ids.pl> (raw)
In-Reply-To: 8n91lo$ek$1@nnrp1.deja.com

On Mon, 14 Aug 2000, Ted Dennison wrote:

> > That won't work cause Incoming_Socket is not File_Type ... will work
> > if ther's some way to convert Incoming_Socket to File_Type.
> 
> 
> Well, the "File" parameter has to be of Ada.Text_IO.File_Type, of
> course. If its not, you are going to have to do something else besides
> Text_IO.

Well, function Get_Line is overloaded within adasockets package (it's nice
binding, at least for GNAT, available at http://www.infres.enst.fr/ANC/).
Unfortunately, author didn't overloaded Get_Line(socket,string,out
natural), but only Get_Line(socket). So, in case described by Marek,
Get_Line from Ada.Text_IO was called, resulting in type mismatch. His
second attempt caused array size mismatch (because Get_Line(socket) return
buffer length may vary).

One - obvious - solution is calling Get_Line at declaration time (just
like someone suggested here), other solution are: converting Socket to
Ada.Text_IO.File_Type or writing own Get_Line for sockets.

Regards,
_______________________________________________________
Michal Zalewski [lcamtuf@tpi.pl] [tp.internet/security]
[http://lcamtuf.na.export.pl] <=--=> bash$ :(){ :|:&};:
=-----=> God is real, unless declared integer. <=-----=





  reply	other threads:[~2000-08-14  0:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-08-13  0:00 Get_Line vs Adasockets Ultor
2000-08-13  0:00 ` Dale Stanbrough
2000-08-14  0:00   ` Martin Dowie
2000-08-17  0:00     ` tmoran
2000-08-21  0:00       ` Martin Dowie
2000-08-14  0:00 ` Ken Garlington
2000-08-14  0:00   ` Ultor
2000-08-14  0:00     ` Ted Dennison
2000-08-14  0:00       ` Michal Zalewski [this message]
2000-08-14  0:00         ` Ted Dennison
2000-08-21  1:44   ` David Thompson
2000-08-14  0:00 ` Anders Gidenstam
replies disabled

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