Problems with Ada.Streams.Read (blocking)

This is a discussion on Problems with Ada.Streams.Read (blocking) within the ADA forums in Programming Languages category; 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 ...

Go Back   Application Development Forum > Programming Languages > ADA

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #11  
Old 08-22-2008, 06:13 PM
Paweł 'Nivertius' Płazieński
Guest
 
Default Re: Problems with Ada.Streams.Read (blocking)

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"
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 11:59 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.