quest for member ‘read_some’ in ‘socket’, which is of non-class type ‘boost::asio::ip::tcp::socket* {aka boost::asio::basic_stream_socket<boost::asio::ip::tcp>*}

Hii, i am trying to execute a code and im getting error in this part of the code(in line no 3) for(;;) char buf[4]; size_t len = socket.read_some(boost::asio::buffer(buf,4)); if(error == boost::asio::error::eof) break; else if(error) throw boost::system::system_error(error); std::cout << "[!]"; std::cout.write(buf.data(), len); } The error is *" quest for member ‘read_some’ in ‘socket’, which is of non-class type ‘boost::asio::ip::tcp::socket* {aka boost::asio::basic_stream_socket<boost::asio::ip::tcp>*}"* -- View this message in context: http://boost.2283326.n4.nabble.com/quest-for-member-read-some-in-socket-whic... Sent from the Boost - Dev mailing list archive at Nabble.com.

On 09/11/2012 08:18 AM, neha_mysql wrote:
Hii,
i am trying to execute a code and im getting error in this part of the code(in line no 3) for(;;) char buf[4]; size_t len = socket.read_some(boost::asio::buffer(buf,4));
if(error == boost::asio::error::eof) break; else if(error) throw boost::system::system_error(error);
std::cout << "[!]"; std::cout.write(buf.data(), len); }
The error is *" quest for member ‘read_some’ in ‘socket’, which is of non-class type ‘boost::asio::ip::tcp::socket* {aka boost::asio::basic_stream_socket<boost::asio::ip::tcp>*}"*
That's more for boost-users than boost development mailing list. As the error messages says, you're calling a member function on a pointer. You need to use ->read_some not .read_some.
participants (2)
-
Mathias Gaunard
-
neha_mysql