Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #30308

Re: A stream/pipe that fills only on demand...

From Martin Gregorie <martin@address-in-sig.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: A stream/pipe that fills only on demand...
Date 2014-11-07 12:27 +0000
Organization A noiseless patient Spider
Message-ID <m3idql$m36$1@dont-email.me> (permalink)
References <slrnm5p4h0.r49.avl@login.logic.tuwien.ac.at>

Show all headers | View raw


On Fri, 07 Nov 2014 09:34:15 +0000, Andreas Leitgeb wrote:

> Normally, when one has a pipe-stream, the pipe gets filled on one side,
> till its full, and drained on the other side while data is needed. If
> less data is needed, then the remaining data in the pipe is discarded.
> (simplified; no nitpicking, please)
> 
> My needs are a bit different, though:  I need a pipe-stream that
> recognizes reader's request for bytes, and tells the writer-end about
> the requested volume, and then the writer will write just as much into
> the pipe as is needed by the reader. The reader just uses the normal API
> that InputStream offers, but I need these calls to identify themselves
> to the pipe-writer, which would use a (yet unspecified) special API, so
> the writer knows how much to put into the pipe-stream.
> 
> Background is, that the items that the writer will put into the
> pipe-stream are "precious" and must not be wasted.
> Kind of like reading back a stream of serialized data, where each
> de-serializing object must not consume more than its own bytes, but the
> Object needing its data is on a different host than the byte stream.
> That's just an analogy - don't stress it.
> 
> Probably it's not rocket science to program it myself, but if it rings a
> bell in someone, I'd appreciate hints about existing technical terms
> and/or implementations.
> I certainly do NOT expect you to implement it for me, and that's also
> why I didn't write up a bullet-proof specificatiion :-)

What are the objections to using sockets to handle what is obviously some 
sort of request/response pairing? Is the response particularly large?


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

A stream/pipe that fills only on demand... Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2014-11-07 09:34 +0000
  Re: A stream/pipe that fills only on demand... Steven Simpson <ss@domain.invalid> - 2014-11-07 10:00 +0000
    Re: A stream/pipe that fills only on demand... Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2014-11-07 15:14 +0000
  Re: A stream/pipe that fills only on demand... Martin Gregorie <martin@address-in-sig.invalid> - 2014-11-07 12:27 +0000
    Re: A stream/pipe that fills only on demand... Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2014-11-07 15:13 +0000
  Re: A stream/pipe that fills only on demand... Robert Klemme <shortcutter@googlemail.com> - 2014-11-08 11:20 +0100
  Re: A stream/pipe that fills only on demand... Nigel Wade <nmw@ion.le.ac.uk> - 2014-11-10 09:24 +0000
    Re: A stream/pipe that fills only on demand... Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2014-11-29 16:02 +0000

csiph-web