comp.lang.ada
 help / color / mirror / Atom feed
From: Maciej Sobczak <see.my.homepage@gmail.com>
Subject: Re: Problems with Ada.Streams.Read (blocking)
Date: Fri, 8 Aug 2008 14:25:33 -0700 (PDT)
Date: 2008-08-08T14:25:33-07:00	[thread overview]
Message-ID: <05f1c5d4-f673-40f5-9aee-dd1fa650a7b6@x35g2000hsb.googlegroups.com> (raw)
In-Reply-To: 150pczbbk7gb2$.1ashrop4xh1b.dlg@40tude.net

On 8 Sie, 20:51, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
wrote:

> You never reach the end of a TCP/IP stream unless the client closes the
> socket, which is usually indicates an error.

This is not true. There are lots of protocols that use the end-of-
stream as an indicator of the end of request group. In such protocols
the client is free to issue new requests whenever he likes and the
server will dutifully *wait* for each of them.

Telnet is one such protocol. HTTP is another (client can ask for the
page and its dependent files like images via a single connection).
CORBA (and virtually every other RPC-like middleware) uses it for
handling many RPC requests from a single client. And so on - the list
is endless.

> The point is that you should never care about the stream end.

The point is that end of stream indicates that the client is not
interested in interaction anymore. This is a valid protocol state.

This is different from the client's perspective, but I can imagine
protocols where the server can respond with potentially endless
answer, not necessarily continuous in time (online stock price
updates?), and finish after a timeout or some other even that is
outside of the client's control. Again, end of stream is a valid
protocol state.

> If you correctly implement the protocol your application will never block

Your application can also block if the other party blocks in the
middle of responding. You cannot fully control it.

--
Maciej Sobczak * www.msobczak.com * www.inspirel.com



  parent reply	other threads:[~2008-08-08 21:25 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 [this message]
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
replies disabled

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