Boost logo

Boost Users :

Subject: Re: [Boost-users] asio nntp reading data
From: Igor R (boost.lists_at_[hidden])
Date: 2010-10-24 07:08:36


> and I see on cout the list (excerpt):
> xs4all.ipv6 0000000481 0000000001 y
> de.comp.lang.vbclassic 0000000257 0000000001 y
> de.comp.office-pakete.ms-office.word 0000000013 0000000001 y
> it.comp.dotnet 0000000074 0000000001 y
> free.timothy.sutter 0000000003 0000000001 y
> free.soc.religion.christian 0000000006 0000000001 y
> free.fan.taylor-momsen 0000000000 0000000001 y
> .
> After the dot, my program doesn't terminate, because the while loop doesn't
> break. I understand the loop in that way: I read some bytes into my stream
> from the socket and write them to the std::cout, if there more bytes the
> loop will continue otherwise (like EOF) the look should be break.

You'll get some error (EOF or similar) if the peer closes the socket
after sending you the data. But if it doesn't close the socket, then
no error occurs, and read() operation will block forever.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net