
6 Jun
2011
6 Jun
'11
8:10 a.m.
Hi, I have an asio::ip::tcp::socket. Whenever I try to read from it, it throws an exception "end of file". But it is possible to write to the socket at any time! This is a client side application, it connects to the server using asio::async_connect(). The server is sending back the data, I checked it with wireshark. I tried using the both async_read() and read(), in both cases it fails with the same error. But both async_write(), and write() works perfectly. What could be the reason? This is how the read call implemented ... .... boost::asio::streambuf b; boost::asio::read(sock,b); //This line causes exception ... Thanks, Lloyd