Boost logo

Boost Users :

Subject: Re: [Boost-users] asio ip::tcp::socket::read(), always returns end of file
From: Lloyd (lloydkl.tech_at_[hidden])
Date: 2011-06-06 08:54:20


Thanks Igor. So I was debugging a problem that doesn't exist :(

On Mon, Jun 6, 2011 at 4:40 PM, Igor R <boost.lists_at_[hidden]> wrote:
>>                        boost::asio::read(sock,b);
>>                }
>>                catch(exception& e)
>>                {
>>                        cout<<e.what()<<endl; //"This exception is thrown always-> "End of file"
>>                }
>
>
>
> So your peer sends some data and closes the socket.
> asio::read() reads this data, and then throws the exception. What
> behavior would you expect?
>
> Please note that this is the *only* way this overload can complete.
> Otherwise, it would just block forever.
> http://www.boost.org/doc/libs/1_46_1/doc/html/boost_asio/reference/read/overload4.html
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


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