本文介绍了提升示例:异步服务器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我花了两天的时间,而当我从链接
中厌倦了他们的"Daytime.3-异步TCP日间服务器"示例时,
http://think-async.com/Asio/boost_asio_1_3_1/doc/html/boost_asio/tutorial/tutdaytime3/src.html [ ^ ]

它在构建时显示以下错误:错误C2039:" io_service:不是" boost :: asio :: basic_socket_acceptor< protocol>
的成员
错误出现在代码部分:

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:

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));
 }



这位于服务器类内部.任何人都可以帮助我解决这个问题.

我正在使用Visual C ++ 2008和Boost 1.47.0.

预先感谢,
hari



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

推荐答案


这篇关于提升示例:异步服务器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 22:17