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,dfddb85b5a048f08 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-18 00:56:01 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.online.be!feed.news.nacamar.de!news.belwue.de!contact.softwarezentrum.de!news.bawue.de!lemmies.lb.bawue.de!not-for-mail From: lemchens@lemmies.lb.bawue.de (arvids lemchens) Newsgroups: comp.lang.ada Subject: Re: GNAT.sockets UDP Example Date: 18 Nov 2002 09:24:00 +0100 Organization: A poorly-maintained Debian GNU/Linux InterNetNews site Sender: news@pd95912b9.dip.t-dialin.net Message-ID: <8a6gFPi+ACB@lemmies.lb.bawue.de> References: <8$vYrY3kACB@lemmies.lb.bawue.de> <8a2dx5TkACB@lemmies.lb.bawue.de> NNTP-Posting-Host: pd95912b9.dip.t-dialin.net X-Trace: pc3.dv-lemchens.de 1037607879 4214 192.168.2.6 (18 Nov 2002 08:24:39 GMT) User-Agent: OpenXP/32 v3.8.7pl1 (Linux) beta @ 2002-10-01-0656f Xref: archiver1.google.com comp.lang.ada:31027 Date: 2002-11-18T09:24:00+01:00 List-Id: Hello Simon, simon@pushface.org am 17.11.02 um 12:38 in comp.lang.ada: > lemchens@lemmies.lb.bawue.de (arvids lemchens) writes: > Kahnung : Ada.Streams.Stream_Element_Array := (1, 2, 3); > Last : Ada.Streams.Stream_Element_Offset; the Last was missing. After adding it, the code compiles and works. Here is the working version (May be it helps someone who is searching for a short, simple example too.): ----- with GNAT.Sockets; use GNAT.Sockets; with Ada.Command_Line; use Ada.Command_Line; with Ada.Exceptions; use Ada.Exceptions; with Ada.Streams; use Ada.Streams; procedure myrdate is Address : Sock_Addr_Type; Socket : Socket_Type; Kahnung : Ada.Streams.Stream_Element_Array := (1, 2, 3, 4); Last : Ada.Streams.Stream_Element_Offset; begin Initialize (Process_Blocking_IO => False); Address.Addr := Addresses (Get_Host_By_Name(Argument(1)), 1); Address.Port := 37; Create_Socket (Socket, Family_Inet, Socket_Datagram); Send_Socket (Socket, Kahnung, Last, Address); Receive_Socket (Socket, Kahnung, Last); Close_Socket(Socket); Finalize; end myrdate; ----- > Send_Socket (Socket, Kahnung, Last, Address); > ends up with a constraint error. Oh well, I guess I need to get GDB > working now ... In the original posted code there was some garbage left, which should be removed, like the channel and RTime, ... MvfG, Arvids