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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c58b7bd180ea81b2 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news1.google.com!news.glorb.com!feeder.erje.net!news.motzarella.org!motzarella.org!not-for-mail From: =?ISO-8859-2?Q?Pawe=B3_=27Nivertius=27_P=B3azie=F1ski?= Newsgroups: comp.lang.ada Subject: Re: Problems with Ada.Streams.Read (blocking) Date: Sat, 23 Aug 2008 00:13:16 +0200 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 8Bit X-Trace: feeder.motzarella.org U2FsdGVkX18ei1LFbAjVbDrPsmxg1F5wSTd764RnZMKthEaEB7pjMX97OCqdFP+ntgYIhjMVL3HhRduYrB/fltKkqjX8q2Bz2pdaEfQDER5MUPVydna7BGEuOOioYL/272ycScNgOZ2JTW5Bq9a9AA== X-Complaints-To: Please send complaints to abuse@motzarella.org with full headers NNTP-Posting-Date: Fri, 22 Aug 2008 22:17:58 +0000 (UTC) X-Auth-Sender: U2FsdGVkX1/yYne+NI6HST/65XjH0IjBn3tl6GXamR6Svu0S0GPVHQ== Cancel-Lock: sha1:wLa9/mM3abuXo7FKp4juRP+5cRY= User-Agent: KNode/0.10.9 Xref: g2news2.google.com comp.lang.ada:7501 Date: 2008-08-23T00:13:16+02:00 List-Id: Dennis Hoppe wrote: > This approach works very well, but some ftp commands send a messages > over several lines. I do not know in advance, how many lines I should > read in. Subsequently, Ada.Streams.Read has to be called in a loop, > which will eventually block, again. > > How can I query the stream, if new elements are ready to read? Altrought you tried using a Control_Socket to read N_Bytes_To_Read. If there's something in the local buffer, you can read without blocking. Probably you can wait some time and test if there's something, if not, it won't probably be sent. This can be good or a totally bad way to do it [random latencies on the line for example]. Just passing around. BTW It never work for me, I tried to use it several times. ;-)) Maybe you'll get more luck with it. -- Pawe� P�azie�ski aka Nivertius "In the end, there will be Ada, XML and gzip"