comp.lang.ada
 help / color / mirror / Atom feed
From: "Paweł 'Nivertius' Płazieński" <nivertius@gmail.com>
Subject: Re: Problems with Ada.Streams.Read (blocking)
Date: Sat, 23 Aug 2008 00:13:16 +0200
Date: 2008-08-23T00:13:16+02:00	[thread overview]
Message-ID: <g8ndum$og8$1@registered.motzarella.org> (raw)
In-Reply-To: g7hher$mtt$1@aioe.org

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"



      parent reply	other threads:[~2008-08-22 22:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-08 13:24 Problems with Ada.Streams.Read (blocking) Dennis Hoppe
2008-08-08 13:56 ` Dmitry A. Kazakov
2008-08-08 18:00   ` Dennis Hoppe
2008-08-08 18:51     ` Dmitry A. Kazakov
2008-08-08 19:37       ` Dennis Hoppe
2008-08-08 21:25       ` Maciej Sobczak
2008-08-09  7:30         ` Dmitry A. Kazakov
2008-08-08 14:48 ` Adam Beneschan
2008-08-08 18:08   ` Dennis Hoppe
2008-08-09  3:04 ` anon
2008-08-22 22:13 ` Paweł 'Nivertius' Płazieński [this message]
replies disabled

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