[Haskell-beginners] Still wrestling with lazy IO

Chaddaï Fouché chaddai.fouche at gmail.com
Sun Jun 19 15:15:42 CEST 2011


On Sat, Jun 18, 2011 at 10:26 PM, Raphael Päbst
<raphael.paebst at googlemail.com> wrote:
> Mainly I'd say it's that I want to send the answer back via the same
> handle. That's where the problem comes from, I suspect. Since it is
> lazy IO, it only evaluates, once the handle gets closed from the
> client side. And then it is too late to send something back. At least
> that's how I understand it.
>

No it don't work like that, what's more probably happening is that
your program is structured so that the answer can't be created until
the "end" of the "request" is read and this "end" won't appear until
eof has been received. You should make it explicit in your request
that it is finished (send two empy lines at the end of the request for
instance). If you don't manage to do that, show us your code so that
we could point out your mistake.

-- 
JedaÏ



More information about the Beginners mailing list