|
Boost Users : |
Subject: Re: [Boost-users] asio nntp reading data
From: Kraus Philipp (philipp.kraus_at_[hidden])
Date: 2010-10-24 07:37:17
Am 24.10.2010 um 13:08 schrieb Igor R:
>> 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.
I don't send data, I receive the data, but how can I check, that I
reach the end of the transmission? It seems the socket will block, so
how can I determine the "end" of the sending data? Should I analyse
the stream data? I know the last char ist a dot. Sorry, I'm a little
bit confused.
Phil
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