Click here to Skip to main content
15,889,266 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi ,
i am learing boost for a couple of days and when i tired their "Daytime.3 - An asynchronous TCP daytime server" example from the link

http://think-async.com/Asio/boost_asio_1_3_1/doc/html/boost_asio/tutorial/tutdaytime3/src.html[^]

it shows the following erro while building :" error C2039: 'io_service' : is not a member of 'boost::asio::basic_socket_acceptor<protocol">

the error is on the code part:

C#
void start_accept()
 {
   tcp_connection::pointer new_connection =
     tcp_connection::create(acceptor_.io_service());

   acceptor_.async_accept(new_connection->socket(),
       boost::bind(&tcp_server::handle_accept, this, new_connection,
         boost::asio::placeholders::error));
 }


this is located inside the server class.can any one help me resolving this .

i am u sing visual c++ 2008 and boost 1.47.0 .

thanks in advance,
hari
Posted

1 solution

According to the Revision History[^], 7th item from the bottom (for the current version 1.47.1).

The io_service() member function was removed.
You will just need to change the name of the function in the source to the new function: get_io_service().

Regards,
 
Share this answer
 
v2
Comments
hariharansa 5-Nov-11 23:36pm    
thanks for the clarification.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900