From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,85adbf2c85d62e36 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-11-02 09:57:34 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!peernews-us.colt.net!newsfeed.news2me.com!arclight.uoregon.edu!wn13feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi_feed4!attbi.com!attbi_s03.POSTED!not-for-mail From: Freejack Subject: Re: More Florist. Newsgroups: comp.lang.ada Message-ID: References: User-Agent: Pan/0.11.4 (Unix) Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Comment-To: "Jeff C," NNTP-Posting-Host: 12.245.85.50 X-Complaints-To: abuse@comcast.net X-Trace: attbi_s03 1067795853 12.245.85.50 (Sun, 02 Nov 2003 17:57:33 GMT) NNTP-Posting-Date: Sun, 02 Nov 2003 17:57:33 GMT Organization: Comcast Online Date: Sun, 02 Nov 2003 17:57:33 GMT Xref: archiver1.google.com comp.lang.ada:1929 Date: 2003-11-02T17:57:33+00:00 List-Id: On Sun, 02 Nov 2003 08:23:51 -0500, Jeff C, wrote: > Have you tried something like > > My_Storage : aliased Database_Array(1 .. 255); > > begin > XXX := Get_Network_Info_By_Name(Name => > The_Name_You_Already_Figured_Out, > Storage => > My_Storage'unchecked_access); > end; > > ....or something along those lines... Alright...here's what I have so far. Still getting Storage_Error. NetDB is the only place I get it.(Why isn't there a simple "Get_Host_By_Name" function? It's the most commonly used NetDB function. Why does one have to parse the thing out of the response generated from the "Get_Network_Info_By_Name" function? A design flaw?) All my other procedures work so far. This is the only one that's chaffing. with Posix; with Posix.Sockets.Internet; with Ada.Text_IO; procedure lookout is package NetSock renames Posix.Sockets.Internet; package TIO renames Ada.Text_IO; Response : Netsock.Network_Info; URL : Posix.Posix_String := "www.yahoo.com"; Address : Posix.Posix_String(1..64); My_Storage : aliased NetSock.Database_Array(1..255); Len : Positive; begin Netsock.Open_Network_Database_Connection(True); Response := NetSock.Get_Network_Info_By_Name(Name => URL, Storage => My_Storage'unrestricted_access); Address := NetSock.Get_Name(Response); Len := Address'length; declare Addr : String(1..Len); begin Addr := Posix.To_String(Address); -- Just to see what the hell Get_Network_Info_By_Name -- -- spits back at me. I have no idea what it'll be. -- TIO.Put_Line("Response was"& Addr &"."); end; NetSock.Close_Network_Database_Connection; end lookout; Heh. Let the chuckles begin. Really though. Does this code make sense? Freejack