Boost logo

Boost Users :

Subject: Re: [Boost-users] asio ip::tcp::socket::read(), always returns end of file
From: Igor R (boost.lists_at_[hidden])
Date: 2011-06-06 07:10:39

>                        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.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at