Boost logo

Boost Users :

Subject: Re: [Boost-users] asio nntp reading data
From: Philipp Kraus (philipp.kraus_at_[hidden])
Date: 2010-10-24 14:01:09


On 2010-10-24 13:46:17 +0200, Igor R said:

>>>
>>> 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.
>
> If the server that sends to you the data doesn't close the socket
> after the transmission, you have to analyse the data and decide when
> you want to stop reading.

Yes you're right. I solve my problem with boost::asio::read_until and
that works now


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